diff --git a/packages/google-cloud-vmwareengine/.OwlBot.yaml b/packages/google-cloud-vmwareengine/.OwlBot.yaml new file mode 100644 index 00000000000..02ce9cf634b --- /dev/null +++ b/packages/google-cloud-vmwareengine/.OwlBot.yaml @@ -0,0 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +deep-copy-regex: + - source: /google/cloud/vmwareengine/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-vmwareengine/$1 \ No newline at end of file diff --git a/packages/google-cloud-vmwareengine/.eslintignore b/packages/google-cloud-vmwareengine/.eslintignore new file mode 100644 index 00000000000..ea5b04aebe6 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ +samples/generated/ diff --git a/packages/google-cloud-vmwareengine/.eslintrc.json b/packages/google-cloud-vmwareengine/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-vmwareengine/.gitattributes b/packages/google-cloud-vmwareengine/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.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-vmwareengine/.gitignore b/packages/google-cloud-vmwareengine/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-vmwareengine/.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-vmwareengine/.jsdoc.js b/packages/google-cloud-vmwareengine/.jsdoc.js new file mode 100644 index 00000000000..9b65af15875 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.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/vmwareengine', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-vmwareengine/.mocharc.js b/packages/google-cloud-vmwareengine/.mocharc.js new file mode 100644 index 00000000000..cdb7b752160 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-vmwareengine/.nycrc b/packages/google-cloud-vmwareengine/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.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-vmwareengine/.prettierignore b/packages/google-cloud-vmwareengine/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-vmwareengine/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-vmwareengine/.prettierrc.js b/packages/google-cloud-vmwareengine/.prettierrc.js new file mode 100644 index 00000000000..d546a4ad546 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-vmwareengine/.repo-metadata.json b/packages/google-cloud-vmwareengine/.repo-metadata.json new file mode 100644 index 00000000000..c8f7524ac10 --- /dev/null +++ b/packages/google-cloud-vmwareengine/.repo-metadata.json @@ -0,0 +1,16 @@ +{ + "name": "vmwareengine", + "name_pretty": "VMware Engine API", + "product_documentation": "cloud.google.com/vmware-engine/", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/vmwareengine/latest", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/google-cloud-node", + "distribution_name": "@google-cloud/vmwareengine", + "api_id": "vmwareengine.googleapis.com", + "default_version": "v1", + "requires_billing": true, + "library_type": "GAPIC_AUTO" +} + diff --git a/packages/google-cloud-vmwareengine/CODE_OF_CONDUCT.md b/packages/google-cloud-vmwareengine/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/CONTRIBUTING.md b/packages/google-cloud-vmwareengine/CONTRIBUTING.md new file mode 100644 index 00000000000..9824f0e8a60 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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 VMware Engine API 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=vmwareengine.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-vmwareengine/LICENSE b/packages/google-cloud-vmwareengine/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/README.md b/packages/google-cloud-vmwareengine/README.md new file mode 100644 index 00000000000..9b299df3a4e --- /dev/null +++ b/packages/google-cloud-vmwareengine/README.md @@ -0,0 +1,256 @@ +[//]: # "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 + +# [VMware Engine API: Node.js Client](https://github.com/googleapis/google-cloud-node) + +[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![npm version](https://img.shields.io/npm/v/@google-cloud/vmwareengine.svg)](https://www.npmjs.org/package/@google-cloud/vmwareengine) + + + + +VMware Engine API client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine/CHANGELOG.md). + +* [VMware Engine API Node.js Client API Reference][client-docs] +* [VMware Engine API Documentation][product-docs] +* [github.com/googleapis/google-cloud-node/packages/google-cloud-vmwareengine](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine) + +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 VMware Engine API 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/vmwareengine +``` + + +### Using the client library + +```javascript +/** + * 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 resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + */ +// const parent = 'abc123' +/** + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ +// const pageSize = 1234 +/** + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + */ +// const pageToken = 'abc123' +/** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + */ +// const filter = 'abc123' +/** + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ +// const orderBy = 'abc123' + +// Imports the Vmwareengine library +const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + +// Instantiates a client +const vmwareengineClient = new VmwareEngineClient(); + +async function callListVmwareEngineNetworks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listVmwareEngineNetworksAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } +} + +callListVmwareEngineNetworks(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Vmware_engine.create_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js,samples/README.md) | +| Vmware_engine.create_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js,samples/README.md) | +| Vmware_engine.create_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js,samples/README.md) | +| Vmware_engine.create_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js,samples/README.md) | +| Vmware_engine.create_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js,samples/README.md) | +| Vmware_engine.delete_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js,samples/README.md) | +| Vmware_engine.delete_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js,samples/README.md) | +| Vmware_engine.delete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js,samples/README.md) | +| Vmware_engine.delete_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js,samples/README.md) | +| Vmware_engine.get_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js,samples/README.md) | +| Vmware_engine.get_hcx_activation_key | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js,samples/README.md) | +| Vmware_engine.get_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js,samples/README.md) | +| Vmware_engine.get_node_type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js,samples/README.md) | +| Vmware_engine.get_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js,samples/README.md) | +| Vmware_engine.get_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js,samples/README.md) | +| Vmware_engine.list_clusters | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js,samples/README.md) | +| Vmware_engine.list_hcx_activation_keys | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js,samples/README.md) | +| Vmware_engine.list_network_policies | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js,samples/README.md) | +| Vmware_engine.list_node_types | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js,samples/README.md) | +| Vmware_engine.list_private_clouds | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js,samples/README.md) | +| Vmware_engine.list_subnets | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js,samples/README.md) | +| Vmware_engine.list_vmware_engine_networks | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js,samples/README.md) | +| Vmware_engine.reset_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js,samples/README.md) | +| Vmware_engine.reset_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js,samples/README.md) | +| Vmware_engine.show_nsx_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js,samples/README.md) | +| Vmware_engine.show_vcenter_credentials | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js,samples/README.md) | +| Vmware_engine.undelete_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js,samples/README.md) | +| Vmware_engine.update_cluster | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js,samples/README.md) | +| Vmware_engine.update_network_policy | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js,samples/README.md) | +| Vmware_engine.update_private_cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js,samples/README.md) | +| Vmware_engine.update_vmware_engine_network | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/test/quickstart.js,samples/README.md) | + + + +The [VMware Engine API 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/vmwareengine@legacy-8` installs client libraries +for versions compatible with Node.js 8. + +## Versioning + +This library follows [Semantic Versioning](http://semver.org/). + + + + +This library is considered to be in **beta**. This means it is expected to be +mostly stable while we work toward a general availability release; however, +complete stability is not guaranteed. We will address issues and requests +against beta libraries with a high priority. + + + + + +More Information: [Google Cloud Platform Launch Stages][launch_stages] + +[launch_stages]: https://cloud.google.com/terms/launch-stages + +## Contributing + +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) + +[client-docs]: https://cloud.google.com/nodejs/docs/reference/vmwareengine/latest +[product-docs]: cloud.google.com/vmware-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=vmwareengine.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started diff --git a/packages/google-cloud-vmwareengine/linkinator.config.json b/packages/google-cloud-vmwareengine/linkinator.config.json new file mode 100644 index 00000000000..befd23c8633 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/package.json b/packages/google-cloud-vmwareengine/package.json new file mode 100644 index 00000000000..4bff21b6a5a --- /dev/null +++ b/packages/google-cloud-vmwareengine/package.json @@ -0,0 +1,71 @@ +{ + "name": "@google-cloud/vmwareengine", + "version": "0.0.0", + "description": "VMware Engine API client for Node.js", + "repository": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-node.git", + "directory": "packages/google-cloud-vmwareengine" + }, + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-vmwareengine", + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google vmwareengine", + "vmwareengine", + "VMware Engine API" + ], + "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": "npm run compile && c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^3.5.2" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^18.0.0", + "@types/sinon": "^10.0.0", + "c8": "^7.3.5", + "gts": "^3.1.0", + "jsdoc": "^4.0.0", + "jsdoc-fresh": "^2.0.0", + "jsdoc-region-tag": "^2.0.0", + "linkinator": "^4.0.0", + "mocha": "^9.2.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^14.0.0", + "ts-loader": "^9.0.0", + "typescript": "^4.6.4", + "webpack": "^5.9.0", + "webpack-cli": "^4.2.0" + }, + "engines": { + "node": ">=12.0.0" + } +} diff --git a/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto new file mode 100644 index 00000000000..695006cf2e2 --- /dev/null +++ b/packages/google-cloud-vmwareengine/protos/google/cloud/vmwareengine/v1/vmwareengine.proto @@ -0,0 +1,2194 @@ +// 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.vmwareengine.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/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.VmwareEngine.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/vmwareengine/v1;vmwareengine"; +option java_multiple_files = true; +option java_outer_classname = "VmwareengineProto"; +option java_package = "com.google.cloud.vmwareengine.v1"; +option php_namespace = "Google\\Cloud\\VmwareEngine\\V1"; +option ruby_package = "Google::Cloud::VmwareEngine::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/Network" + pattern: "projects/{project}/global/networks/{network}" +}; + +// VMwareEngine manages VMware's private clusters in the Cloud. +service VmwareEngine { + option (google.api.default_host) = "vmwareengine.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists `PrivateCloud` resources in a given project and location. + rpc ListPrivateClouds(ListPrivateCloudsRequest) returns (ListPrivateCloudsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/privateClouds" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a `PrivateCloud` resource by its resource name. + rpc GetPrivateCloud(GetPrivateCloudRequest) returns (PrivateCloud) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateClouds/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new `PrivateCloud` resource in a given project and location. + // Private clouds can only be created in zones, regional private clouds are + // not supported. + // + // Creating a private cloud also creates a [management + // cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) + // for that private cloud. + rpc CreatePrivateCloud(CreatePrivateCloudRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/privateClouds" + body: "private_cloud" + }; + option (google.api.method_signature) = "parent,private_cloud,private_cloud_id"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Modifies a `PrivateCloud` resource. Only the following fields can be + // updated: `description`. + // Only fields specified in `updateMask` are applied. + // + // During operation processing, the resource is temporarily in the `ACTIVE` + // state before the operation fully completes. For that period of time, you + // can't update the resource. Use the operation status to determine when the + // processing fully completes. + rpc UpdatePrivateCloud(UpdatePrivateCloudRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{private_cloud.name=projects/*/locations/*/privateClouds/*}" + body: "private_cloud" + }; + option (google.api.method_signature) = "private_cloud,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Schedules a `PrivateCloud` resource for deletion. + // + // A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` + // set to `DELETED` and `expireTime` set to the time when deletion is final + // and can no longer be reversed. The delete operation is marked as done + // as soon as the `PrivateCloud` is successfully scheduled for deletion + // (this also applies when `delayHours` is set to zero), and the operation is + // not kept in pending state until `PrivateCloud` is purged. + // `PrivateCloud` can be restored using `UndeletePrivateCloud` method before + // the `expireTime` elapses. When `expireTime` is reached, deletion is final + // and all private cloud resources are irreversibly removed and billing stops. + // During the final removal process, `PrivateCloud.state` is set to `PURGING`. + // `PrivateCloud` can be polled using standard `GET` method for the whole + // period of deletion and purging. It will not be returned only + // when it is completely purged. + rpc DeletePrivateCloud(DeletePrivateCloudRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/privateClouds/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Restores a private cloud that was previously scheduled for deletion by + // `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has + // `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to + // the time when deletion can no longer be reversed. + rpc UndeletePrivateCloud(UndeletePrivateCloudRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/privateClouds/*}:undelete" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Lists `Cluster` resources in a given private cloud. + rpc ListClusters(ListClustersRequest) returns (ListClustersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a `Cluster` resource by its resource name. + rpc GetCluster(GetClusterRequest) returns (Cluster) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateClouds/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new cluster in a given private cloud. + // Creating a new cluster provides additional nodes for + // use in the parent private cloud and requires sufficient [node + // quota](https://cloud.google.com/vmware-engine/quotas). + rpc CreateCluster(CreateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters" + body: "cluster" + }; + option (google.api.method_signature) = "parent,cluster,cluster_id"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Modifies a `Cluster` resource. Only the following fields can be updated: + // `node_type_configs.*.node_count`. Only fields specified in `updateMask` are + // applied. + // + // During operation processing, the resource is temporarily in the `ACTIVE` + // state before the operation fully completes. For that period of time, you + // can't update the resource. Use the operation status to determine when the + // processing fully completes. + rpc UpdateCluster(UpdateClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{cluster.name=projects/*/locations/*/privateClouds/*/clusters/*}" + body: "cluster" + }; + option (google.api.method_signature) = "cluster,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Cluster" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a `Cluster` resource. To avoid unintended data loss, migrate or + // gracefully shut down any workloads running on the cluster before deletion. + // You cannot delete the management cluster of a private cloud using this + // method. + rpc DeleteCluster(DeleteClusterRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/privateClouds/*/clusters/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists subnets in a given private cloud. + rpc ListSubnets(ListSubnetsRequest) returns (ListSubnetsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/privateClouds/*}/subnets" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists node types + rpc ListNodeTypes(ListNodeTypesRequest) returns (ListNodeTypesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/nodeTypes" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single `NodeType`. + rpc GetNodeType(GetNodeTypeRequest) returns (NodeType) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/nodeTypes/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Gets details of credentials for NSX appliance. + rpc ShowNsxCredentials(ShowNsxCredentialsRequest) returns (Credentials) { + option (google.api.http) = { + get: "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showNsxCredentials" + }; + option (google.api.method_signature) = "private_cloud"; + } + + // Gets details of credentials for Vcenter appliance. + rpc ShowVcenterCredentials(ShowVcenterCredentialsRequest) returns (Credentials) { + option (google.api.http) = { + get: "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showVcenterCredentials" + }; + option (google.api.method_signature) = "private_cloud"; + } + + // Resets credentials of the NSX appliance. + rpc ResetNsxCredentials(ResetNsxCredentialsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetNsxCredentials" + body: "*" + }; + option (google.api.method_signature) = "private_cloud"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Resets credentials of the Vcenter appliance. + rpc ResetVcenterCredentials(ResetVcenterCredentialsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetVcenterCredentials" + body: "*" + }; + option (google.api.method_signature) = "private_cloud"; + option (google.longrunning.operation_info) = { + response_type: "PrivateCloud" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new HCX activation key in a given private cloud. + rpc CreateHcxActivationKey(CreateHcxActivationKeyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys" + body: "hcx_activation_key" + }; + option (google.api.method_signature) = "parent,hcx_activation_key,hcx_activation_key_id"; + option (google.longrunning.operation_info) = { + response_type: "HcxActivationKey" + metadata_type: "OperationMetadata" + }; + } + + // Lists `HcxActivationKey` resources in a given private cloud. + rpc ListHcxActivationKeys(ListHcxActivationKeysRequest) returns (ListHcxActivationKeysResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys" + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves a `HcxActivationKey` resource by its resource name. + rpc GetHcxActivationKey(GetHcxActivationKeyRequest) returns (HcxActivationKey) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Retrieves a `NetworkPolicy` resource by its resource name. + rpc GetNetworkPolicy(GetNetworkPolicyRequest) returns (NetworkPolicy) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/networkPolicies/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists `NetworkPolicy` resources in a specified project and location. + rpc ListNetworkPolicies(ListNetworkPoliciesRequest) returns (ListNetworkPoliciesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/networkPolicies" + }; + option (google.api.method_signature) = "parent"; + } + + // Creates a new network policy in a given VMware Engine network of a + // project and location (region). A new network policy cannot be created if + // another network policy already exists in the same scope. + rpc CreateNetworkPolicy(CreateNetworkPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/networkPolicies" + body: "network_policy" + }; + option (google.api.method_signature) = "parent,network_policy,network_policy_id"; + option (google.longrunning.operation_info) = { + response_type: "NetworkPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Modifies a `NetworkPolicy` resource. Only the following fields can be + // updated: `internet_access`, `external_ip`, `edge_services_cidr`. + // Only fields specified in `updateMask` are applied. When updating a network + // policy, the external IP network service can only be disabled if there are + // no external IP addresses present in the scope of the policy. Also, a + // `NetworkService` cannot be updated when `NetworkService.state` is set + // to `RECONCILING`. + // + // During operation processing, the resource is temporarily in the `ACTIVE` + // state before the operation fully completes. For that period of time, you + // can't update the resource. Use the operation status to determine when the + // processing fully completes. + rpc UpdateNetworkPolicy(UpdateNetworkPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{network_policy.name=projects/*/locations/*/networkPolicies/*}" + body: "network_policy" + }; + option (google.api.method_signature) = "network_policy,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "NetworkPolicy" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a `NetworkPolicy` resource. A network policy cannot be deleted + // when `NetworkService.state` is set to `RECONCILING` for either its external + // IP or internet access service. + rpc DeleteNetworkPolicy(DeleteNetworkPolicyRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/networkPolicies/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new VMware Engine network that can be used by a private cloud. + rpc CreateVmwareEngineNetwork(CreateVmwareEngineNetworkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks" + body: "vmware_engine_network" + }; + option (google.api.method_signature) = "parent,vmware_engine_network,vmware_engine_network_id"; + option (google.longrunning.operation_info) = { + response_type: "VmwareEngineNetwork" + metadata_type: "OperationMetadata" + }; + } + + // Modifies a VMware Engine network resource. Only the following fields can be + // updated: `description`. Only fields specified in `updateMask` are + // applied. + rpc UpdateVmwareEngineNetwork(UpdateVmwareEngineNetworkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{vmware_engine_network.name=projects/*/locations/*/vmwareEngineNetworks/*}" + body: "vmware_engine_network" + }; + option (google.api.method_signature) = "vmware_engine_network,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "VmwareEngineNetwork" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware + // Engine network after all resources that refer to it are deleted. For + // example, a private cloud, a network peering, and a network policy can all + // refer to the same VMware Engine network. + rpc DeleteVmwareEngineNetwork(DeleteVmwareEngineNetworkRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Retrieves a `VmwareEngineNetwork` resource by its resource name. The + // resource contains details of the VMware Engine network, such as its VMware + // Engine network type, peered networks in a service project, and state + // (for example, `CREATING`, `ACTIVE`, `DELETING`). + rpc GetVmwareEngineNetwork(GetVmwareEngineNetworkRequest) returns (VmwareEngineNetwork) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists `VmwareEngineNetwork` resources in a given project and location. + rpc ListVmwareEngineNetworks(ListVmwareEngineNetworksRequest) returns (ListVmwareEngineNetworksResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Network configuration in the consumer project +// with which the peering has to be done. +message NetworkConfig { + // Required. Management CIDR used by VMware management appliances. + string management_cidr = 4 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The relative resource name of the VMware Engine network attached + // to the private cloud. Specify the name in the following form: + // `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + // where `{project}` can either be a project number or a project ID. + string vmware_engine_network = 5 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Output only. The canonical name of the VMware Engine network in the form: + // `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + string vmware_engine_network_canonical = 6 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Output only. The IP address layout version of the management IP address + // range. Possible versions include: + // * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address + // layout used by some existing private clouds. This is no longer supported + // for new private clouds as it does not support all features. + // * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address + // layout used by all newly created private clouds. This version supports all + // current features. + int32 management_ip_address_layout_version = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information about the type and number of nodes associated with the cluster. +message NodeTypeConfig { + // Required. The number of nodes of this type in the cluster + int32 node_count = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Customized number of cores available to each node of the type. + // This number must always be one of `nodeType.availableCustomCoreCounts`. + // If zero is provided max value from `nodeType.availableCustomCoreCounts` + // will be used. + int32 custom_core_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a private cloud resource. Private clouds are zonal resources. +message PrivateCloud { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + pattern: "projects/{project}/locations/{location}/privateClouds/{private_cloud}" + }; + + // Enum State defines possible states of private clouds. + enum State { + // The default value. This value should never be used. + STATE_UNSPECIFIED = 0; + + // The private cloud is ready. + ACTIVE = 1; + + // The private cloud is being created. + CREATING = 2; + + // The private cloud is being updated. + UPDATING = 3; + + // The private cloud is in failed state. + FAILED = 5; + + // The private cloud is scheduled for deletion. The deletion process can be + // cancelled by using the corresponding undelete method. + DELETED = 6; + + // The private cloud is irreversibly deleted and is being removed from the + // system. + PURGING = 7; + } + + // Management cluster configuration. + message ManagementCluster { + // Required. The user-provided identifier of the new `Cluster`. + // The identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC + // 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5) + string cluster_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The map of cluster node types in this cluster, where the key is canonical + // identifier of the node type (corresponds to the `NodeType`). + map node_type_configs = 7 [(google.api.field_behavior) = REQUIRED]; + } + + // Output only. The resource name of this private cloud. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this resource. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of this resource. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the resource was scheduled for deletion. + google.protobuf.Timestamp delete_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Time when the resource will be irreversibly deleted. + google.protobuf.Timestamp expire_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the resource. New values may be added to this enum + // when appropriate. + State state = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. Network configuration of the private cloud. + NetworkConfig network_config = 9 [(google.api.field_behavior) = REQUIRED]; + + // Input only. The management cluster for this private cloud. + // This field is required during creation of the private cloud to provide + // details for the default cluster. + // + // The following fields can't be changed after private cloud creation: + // `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`. + ManagementCluster management_cluster = 10 [(google.api.field_behavior) = INPUT_ONLY]; + + // User-provided description for this private cloud. + string description = 11; + + // Output only. HCX appliance. + Hcx hcx = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. NSX appliance. + Nsx nsx = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Vcenter appliance. + Vcenter vcenter = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System-generated unique identifier for the resource. + string uid = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds] +message ListPrivateCloudsRequest { + // Required. The resource name of the private cloud to be queried for + // clusters. Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of private clouds to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListPrivateClouds` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListPrivateClouds` must + // match the call that provided the page token. + string page_token = 3; + + // A filter expression that matches resources returned in the response. + // The expression must specify the field name, a comparison operator, and the + // value that you want to use for filtering. The value must be a string, a + // number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + // `<`. + // + // For example, if you are filtering a list of private clouds, you can exclude + // the ones named `example-pc` by specifying `name != "example-pc"`. + // + // You can also filter nested fields. For example, you could specify + // `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + // only if they have a matching address in their network configuration. + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "example-pc") + // (createTime > "2021-04-12T08:15:10.40Z") + // ``` + // + // By default, each expression is an `AND` expression. However, you can + // include `AND` and `OR` expressions explicitly. For example: + // ``` + // (name = "private-cloud-1") AND + // (createTime > "2021-04-12T08:15:10.40Z") OR + // (name = "private-cloud-2") + // ``` + string filter = 4; + + // Sorts list results by a certain order. By default, returned results are + // ordered by `name` in ascending order. You can also sort results in + // descending order based on the `name` value using `orderBy="name desc"`. + // Currently, only ordering by `name` is supported. + string order_by = 5; +} + +// Response message for [VmwareEngine.ListPrivateClouds][google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds] +message ListPrivateCloudsResponse { + // A list of private clouds. + repeated PrivateCloud private_clouds = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// Request message for [VmwareEngine.GetPrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud] +message GetPrivateCloudRequest { + // Required. The resource name of the private cloud to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; +} + +// Request message for [VmwareEngine.CreatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud] +message CreatePrivateCloudRequest { + // Required. The resource name of the location to create the new + // private cloud in. Resource names are schemeless URIs that follow the + // conventions in https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The user-provided identifier of the private cloud to be created. + // This identifier must be unique among each `PrivateCloud` within the parent + // and becomes the final token in the name URI. + // The identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string private_cloud_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial description of the new private cloud. + PrivateCloud private_cloud = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if you want the request to be validated and not executed; false + // otherwise. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.UpdatePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud] +message UpdatePrivateCloudRequest { + // Required. Private cloud description. + PrivateCloud private_cloud = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask is used to specify the fields to be overwritten in the + // `PrivateCloud` resource by the update. The fields specified in `updateMask` + // 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 = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.DeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud] +message DeletePrivateCloudRequest { + // Required. The resource name of the private cloud to delete. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // Optional. 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]; + + // Optional. If set to true, cascade delete is enabled and all children of this private + // cloud resource are also deleted. When this flag is set to false, the + // private cloud will not be deleted if there are any children other than the + // management cluster. The management cluster is always deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Time delay of the deletion specified in hours. The default value + // is `3`. Specifying a non-zero value for this field changes the value of + // `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + // deletion time. Deletion can be cancelled before `expire_time` elapses using + // [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud]. Specifying a value of `0` for + // this field instead begins the deletion process and ceases billing + // immediately. During the final deletion process, the value of + // `PrivateCloud.state` becomes `PURGING`. + optional int32 delay_hours = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.UndeletePrivateCloud][google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud] +message UndeletePrivateCloudRequest { + // Required. The resource name of the private cloud scheduled for deletion. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // Optional. 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]; +} + +// A cluster in a private cloud. +message Cluster { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/Cluster" + pattern: "projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}" + }; + + // Enum State defines possible states of private cloud clusters. + enum State { + // The default value. This value should never be used. + STATE_UNSPECIFIED = 0; + + // The Cluster is operational and can be used by the user. + ACTIVE = 1; + + // The Cluster is being deployed. + CREATING = 2; + + // Adding or removing of a node to the cluster, any other cluster specific + // updates. + UPDATING = 3; + + // The Cluster is being deleted. + DELETING = 4; + + // The Cluster is undergoing maintenance, for example: a failed node is + // getting replaced. + REPAIRING = 5; + } + + // Output only. The resource name of this cluster. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this resource. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of this resource. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the resource. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. True if the cluster is a management cluster; false otherwise. + // There can only be one management cluster in a private cloud + // and it has to be the first one. + bool management = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System-generated unique identifier for the resource. + string uid = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The map of cluster node types in this cluster, where the key is canonical + // identifier of the node type (corresponds to the `NodeType`). + map node_type_configs = 16 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters] +message ListClustersRequest { + // Required. The resource name of the private cloud to query for clusters. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // The maximum number of clusters to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListClusters` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to `ListClusters` + // must match the call that provided the page token. + string page_token = 3; + + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "example-cluster") + // (nodeCount = "3") + // ``` + // + // By default, each expression is an `AND` expression. However, you can + // include `AND` and `OR` expressions explicitly. For example: + // ``` + // (name = "example-cluster-1") AND + // (createTime > "2021-04-12T08:15:10.40Z") OR + // (name = "example-cluster-2") + // ``` + string filter = 4; + + // Sorts list results by a certain order. By default, returned results are + // ordered by `name` in ascending order. You can also sort results in + // descending order based on the `name` value using `orderBy="name desc"`. + // Currently, only ordering by `name` is supported. + string order_by = 5; +} + +// Response message for [VmwareEngine.ListClusters][google.cloud.vmwareengine.v1.VmwareEngine.ListClusters] +message ListClustersResponse { + // A list of private cloud clusters. + repeated Cluster clusters = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// Request message for [VmwareEngine.GetCluster][google.cloud.vmwareengine.v1.VmwareEngine.GetCluster] +message GetClusterRequest { + // Required. The cluster resource name to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/Cluster" + } + ]; +} + +// Request message for [VmwareEngine.CreateCluster][google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster] +message CreateClusterRequest { + // Required. The resource name of the private cloud to create a new cluster + // in. Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // Required. The user-provided identifier of the new `Cluster`. + // This identifier must be unique among clusters within the parent and becomes + // the final token in the name URI. + // The identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string cluster_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial description of the new cluster. + Cluster cluster = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if you want the request to be validated and not executed; false + // otherwise. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.UpdateCluster][google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster] +message UpdateClusterRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // `Cluster` resource by the update. The fields specified in the `updateMask` + // 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 [(google.api.field_behavior) = REQUIRED]; + + // Required. The description of the cluster. + Cluster cluster = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. 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 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. True if you want the request to be validated and not executed; false + // otherwise. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.DeleteCluster][google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster] +message DeleteClusterRequest { + // Required. The resource name of the cluster to delete. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/Cluster" + } + ]; + + // Optional. 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]; +} + +// Subnet in a private cloud. Either `management` subnets (such as vMotion) that +// are read-only, or `userDefined`, which can also be updated. +message Subnet { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/Subnet" + pattern: "projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}" + }; + + // Defines possible states of subnets. + enum State { + // The default value. This value should never be used. + STATE_UNSPECIFIED = 0; + + // The subnet is ready. + ACTIVE = 1; + + // The subnet is being created. + CREATING = 2; + + // The subnet is being updated. + UPDATING = 3; + + // The subnet is being deleted. + DELETING = 4; + } + + // Output only. The resource name of this subnet. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/subnets/my-subnet` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The IP address range of the subnet in CIDR format '10.0.0.0/24'. + string ip_cidr_range = 7; + + // The IP address of the gateway of this subnet. + // Must fall within the IP prefix defined above. + string gateway_ip = 8; + + // Output only. The type of the subnet. For example "management" or "userDefined". + string type = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the resource. + State state = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets] +message ListSubnetsRequest { + // Required. The resource name of the private cloud to be queried for + // subnets. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // The maximum number of subnets to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListSubnetsRequest` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListSubnetsRequest` must match the call that provided the page token. + string page_token = 3; +} + +// Response message for [VmwareEngine.ListSubnets][google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets] +message ListSubnetsResponse { + // A list of subnets. + repeated Subnet subnets = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// 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. True if the user has requested cancellation + // of the operation; false otherwise. + // 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]; +} + +// Describes node type. +message NodeType { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/NodeType" + pattern: "projects/{project}/locations/{location}/nodeTypes/{node_type}" + }; + + // Output only. The resource name of this node type. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-proj/locations/us-west1-a/nodeTypes/standard-72` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The canonical identifier of the node type + // (corresponds to the `NodeType`). For example: standard-72. + string node_type_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The friendly name for this node type. + // For example: ve1-standard-72 + string display_name = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of virtual CPUs in a single node. + int32 virtual_cpu_count = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The total number of CPU cores in a single node. + int32 total_core_count = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The amount of physical memory available, defined in GB. + int32 memory_gb = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The amount of storage available, defined in GB. + int32 disk_size_gb = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. List of possible values of custom core count. + repeated int32 available_custom_core_counts = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes] +message ListNodeTypesRequest { + // Required. The resource name of the location to be queried for node types. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of node types to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListNodeTypes` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListNodeTypes` must match the call that provided the page token. + string page_token = 3; + + // A filter expression that matches resources returned in the response. + // The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value + // must be a string, a number, or a boolean. The comparison operator + // must be `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering a list of node types, you can + // exclude the ones named `standard-72` by specifying + // `name != "standard-72"`. + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "standard-72") + // (virtual_cpu_count > 2) + // ``` + // + // By default, each expression is an `AND` expression. However, you + // can include `AND` and `OR` expressions explicitly. + // For example: + // ``` + // (name = "standard-96") AND + // (virtual_cpu_count > 2) OR + // (name = "standard-72") + // ``` + string filter = 4; +} + +// Response message for [VmwareEngine.ListNodeTypes][google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes] +message ListNodeTypesResponse { + // A list of Node Types. + repeated NodeType node_types = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// Request message for [VmwareEngine.GetNodeType][google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType] +message GetNodeTypeRequest { + // Required. The resource name of the node type to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-proj/locations/us-west1-a/nodeTypes/standard-72` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/NodeType" + } + ]; +} + +// Credentials for a private cloud. +message Credentials { + // Initial username. + string username = 1; + + // Initial password. + string password = 2; +} + +// Request message for [VmwareEngine.ShowNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials] +message ShowNsxCredentialsRequest { + // Required. The resource name of the private cloud + // to be queried for credentials. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string private_cloud = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; +} + +// Request message for [VmwareEngine.ShowVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials] +message ShowVcenterCredentialsRequest { + // Required. The resource name of the private cloud + // to be queried for credentials. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string private_cloud = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; +} + +// Request message for [VmwareEngine.ResetNsxCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials] +message ResetNsxCredentialsRequest { + // Required. The resource name of the private cloud + // to reset credentials for. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string private_cloud = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [VmwareEngine.ResetVcenterCredentials][google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials] +message ResetVcenterCredentialsRequest { + // Required. The resource name of the private cloud + // to reset credentials for. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + string private_cloud = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys] +message ListHcxActivationKeysResponse { + // List of HCX activation keys. + repeated HcxActivationKey hcx_activation_keys = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// HCX activation key. A default key is created during +// private cloud provisioning, but this behavior is subject to change +// and you should always verify active keys. +// Use [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys] to retrieve existing keys +// and [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey] to create new ones. +message HcxActivationKey { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/HcxActivationKey" + pattern: "projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}" + }; + + // State of HCX activation key + enum State { + // Unspecified state. + STATE_UNSPECIFIED = 0; + + // State of a newly generated activation key. + AVAILABLE = 1; + + // State of key when it has been used to activate HCX appliance. + CONSUMED = 2; + + // State of key when it is being created. + CREATING = 3; + } + + // Output only. The resource name of this HcxActivationKey. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1/privateClouds/my-cloud/hcxActivationKeys/my-key` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of HCX activation key. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of HCX activation key. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. HCX activation key. + string activation_key = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. System-generated unique identifier for the resource. + string uid = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for [VmwareEngine.ListHcxActivationKeys][google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys] +message ListHcxActivationKeysRequest { + // Required. The resource name of the private cloud + // to be queried for HCX activation keys. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/privateClouds/my-cloud` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // The maximum number of HCX activation keys to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListHcxActivationKeys` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListHcxActivationKeys` must match the call that provided the page + // token. + string page_token = 3; +} + +// Request message for [VmwareEngine.GetHcxActivationKeys][] +message GetHcxActivationKeyRequest { + // Required. The resource name of the HCX activation key to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-west1/privateClouds/my-cloud/hcxActivationKeys/my-key` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/HcxActivationKey" + } + ]; +} + +// Request message for [VmwareEngine.CreateHcxActivationKey][google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey] +message CreateHcxActivationKeyRequest { + // Required. The resource name of the private cloud to create the key for. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/privateClouds/my-cloud` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/PrivateCloud" + } + ]; + + // Required. The initial description of a new HCX activation key. When + // creating a new key, this field must be an empty object. + HcxActivationKey hcx_activation_key = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The user-provided identifier of the `HcxActivationKey` to be + // created. This identifier must be unique among `HcxActivationKey` resources + // within the parent and becomes the final token in the name URI. + // The identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string hcx_activation_key_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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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; +} + +// Details about a HCX Cloud Manager appliance. +message Hcx { + // State of the appliance + enum State { + // Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0; + + // The appliance is operational and can be used. + ACTIVE = 1; + + // The appliance is being deployed. + CREATING = 2; + } + + // Internal IP address of the appliance. + string internal_ip = 2; + + // Version of the appliance. + string version = 4; + + // Output only. The state of the appliance. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Fully qualified domain name of the appliance. + string fqdn = 6; +} + +// Details about a NSX Manager appliance. +message Nsx { + // State of the appliance + enum State { + // Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0; + + // The appliance is operational and can be used. + ACTIVE = 1; + + // The appliance is being deployed. + CREATING = 2; + } + + // Internal IP address of the appliance. + string internal_ip = 2; + + // Version of the appliance. + string version = 4; + + // Output only. The state of the appliance. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Fully qualified domain name of the appliance. + string fqdn = 6; +} + +// Details about a vCenter Server management appliance. +message Vcenter { + // State of the appliance + enum State { + // Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0; + + // The appliance is operational and can be used. + ACTIVE = 1; + + // The appliance is being deployed. + CREATING = 2; + } + + // Internal IP address of the appliance. + string internal_ip = 2; + + // Version of the appliance. + string version = 4; + + // Output only. The state of the appliance. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Fully qualified domain name of the appliance. + string fqdn = 6; +} + +// Represents a network policy resource. Network policies are regional +// resources. You can use a network policy to enable or disable internet access +// and external IP access. Network policies are associated with a VMware Engine +// network, which might span across regions. For a given region, a network +// policy applies to all private clouds in the VMware Engine network associated +// with the policy. +message NetworkPolicy { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/NetworkPolicy" + pattern: "projects/{project}/locations/{location}/networkPolicies/{network_policy}" + }; + + // Represents a network service that is managed by a `NetworkPolicy` resource. + // A network service provides a way to control an aspect of external access to + // VMware workloads. For example, whether the VMware workloads in the + // private clouds governed by a network policy can access or be accessed from + // the internet. + message NetworkService { + // Enum State defines possible states of a network policy controlled + // service. + enum State { + // Unspecified service state. This is the default value. + STATE_UNSPECIFIED = 0; + + // Service is not provisioned. + UNPROVISIONED = 1; + + // Service is in the process of being provisioned/deprovisioned. + RECONCILING = 2; + + // Service is active. + ACTIVE = 3; + } + + // True if the service is enabled; false otherwise. + bool enabled = 1; + + // Output only. State of the service. New values may be added to this enum + // when appropriate. + State state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The resource name of this network policy. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this resource. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of this resource. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Network service that allows VMware workloads to access the internet. + NetworkService internet_access = 6; + + // Network service that allows External IP addresses to be assigned to VMware + // workloads. This service can only be enabled when `internet_access` is also + // enabled. + NetworkService external_ip = 7; + + // Required. IP address range in CIDR notation used to create internet access + // and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is + // required. The range cannot overlap with any prefixes either in the consumer + // VPC network or in use by the private clouds attached to that VPC network. + string edge_services_cidr = 9 [(google.api.field_behavior) = REQUIRED]; + + // Output only. System-generated unique identifier for the resource. + string uid = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The relative resource name of the VMware Engine network. + // Specify the name in the following form: + // `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + // where `{project}` can either be a project number or a project ID. + string vmware_engine_network = 12 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Optional. User-provided description for this network policy. + string description = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The canonical name of the VMware Engine network in the form: + // `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + string vmware_engine_network_canonical = 14 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; +} + +// Request message for [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies] +message ListNetworkPoliciesRequest { + // Required. The resource name of the location (region) to query for + // network policies. Resource names are schemeless URIs that follow the + // conventions in https://cloud.google.com/apis/design/resource_names. For + // example: `projects/my-project/locations/us-central1` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmwareengine.googleapis.com/NetworkPolicy" + } + ]; + + // The maximum number of network policies to return in one page. + // The service may return fewer than this value. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListNetworkPolicies` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListNetworkPolicies` must match the call that provided the page + // token. + string page_token = 3; + + // A filter expression that matches resources returned in the response. + // The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value + // must be a string, a number, or a boolean. The comparison operator + // must be `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering a list of network policies, you can + // exclude the ones named `example-policy` by specifying + // `name != "example-policy"`. + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "example-policy") + // (createTime > "2021-04-12T08:15:10.40Z") + // ``` + // + // By default, each expression is an `AND` expression. However, you + // can include `AND` and `OR` expressions explicitly. + // For example: + // ``` + // (name = "example-policy-1") AND + // (createTime > "2021-04-12T08:15:10.40Z") OR + // (name = "example-policy-2") + // ``` + string filter = 4; + + // Sorts list results by a certain order. By default, returned results + // are ordered by `name` in ascending order. + // You can also sort results in descending order based on the `name` value + // using `orderBy="name desc"`. + // Currently, only ordering by `name` is supported. + string order_by = 5; +} + +// Response message for [VmwareEngine.ListNetworkPolicies][google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies] +message ListNetworkPoliciesResponse { + // A list of network policies. + repeated NetworkPolicy network_policies = 1; + + // A token, which can be send as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Locations that could not be reached when making an aggregated query using + // wildcards. + repeated string unreachable = 3; +} + +// Request message for [VmwareEngine.GetNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy] +message GetNetworkPolicyRequest { + // Required. The resource name of the network policy to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/NetworkPolicy" + } + ]; +} + +// Request message for [VmwareEngine.UpdateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy] +message UpdateNetworkPolicyRequest { + // Required. Network policy description. + NetworkPolicy network_policy = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask is used to specify the fields to be overwritten in the + // `NetworkPolicy` 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 = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.CreateNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy] +message CreateNetworkPolicyRequest { + // Required. The resource name of the location (region) + // to create the new network policy in. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmwareengine.googleapis.com/NetworkPolicy" + } + ]; + + // Required. The user-provided identifier of the network policy to be created. + // This identifier must be unique within parent + // `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + // the final token in the name URI. + // The identifier must meet the following requirements: + // + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string network_policy_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The network policy configuration to use in the request. + NetworkPolicy network_policy = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.DeleteNetworkPolicy][google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy] +message DeleteNetworkPolicyRequest { + // Required. The resource name of the network policy to delete. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/NetworkPolicy" + } + ]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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]; +} + +// VMware Engine network resource that provides connectivity for VMware Engine +// private clouds. +message VmwareEngineNetwork { + option (google.api.resource) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + pattern: "projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}" + }; + + // Represents a VMware Engine VPC network that is managed by a + // VMware Engine network resource. + message VpcNetwork { + // Enum Type defines possible types of a VMware Engine network controlled + // service. + enum Type { + // The default value. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // VPC network that will be peered with a consumer VPC network or the + // intranet VPC of another VMware Engine network. Access a private cloud + // through Compute Engine VMs on a peered VPC network or an on-premises + // resource connected to a peered consumer VPC network. + INTRANET = 1; + + // VPC network used for internet access to and from a private cloud. + INTERNET = 2; + + // VPC network used for access to Google Cloud services like + // Cloud Storage. + GOOGLE_CLOUD = 3; + } + + // Output only. Type of VPC network (INTRANET, INTERNET, or + // GOOGLE_CLOUD) + Type type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The relative resource name of the service VPC network this + // VMware Engine network is attached to. For example: + // `projects/123123/global/networks/my-network` + string network = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "compute.googleapis.com/Network" + } + ]; + } + + // Enum State defines possible states of VMware Engine network. + enum State { + // The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0; + + // The VMware Engine network is being created. + CREATING = 1; + + // The VMware Engine network is ready. + ACTIVE = 2; + + // The VMware Engine network is being updated. + UPDATING = 3; + + // The VMware Engine network is being deleted. + DELETING = 4; + } + + // Enum Type defines possible types of VMware Engine network. + enum Type { + // The default value. This value should never be used. + TYPE_UNSPECIFIED = 0; + + // Network type used by private clouds created in projects without a network + // of type `STANDARD`. This network type is no longer used for new VMware + // Engine private cloud deployments. + LEGACY = 1; + } + + // Output only. The resource name of the VMware Engine network. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Creation time of this resource. + google.protobuf.Timestamp create_time = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Last update time of this resource. + google.protobuf.Timestamp update_time = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-provided description for this VMware Engine network. + string description = 5; + + // Output only. VMware Engine service VPC networks that provide connectivity + // from a private cloud to customer projects, the internet, and other Google + // Cloud services. + repeated VpcNetwork vpc_networks = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. State of the VMware Engine network. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. VMware Engine network type. + Type type = 8 [(google.api.field_behavior) = REQUIRED]; + + // Output only. System-generated unique identifier for the resource. + string uid = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Checksum that may be sent on update and delete requests to ensure that the + // user-provided value is up to date before the server processes a request. + // The server computes checksums based on the value of other fields in the + // request. + string etag = 10; +} + +// Request message for [VmwareEngine.CreateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork] +message CreateVmwareEngineNetworkRequest { + // Required. The resource name of the location to create the new VMware Engine + // network in. A VMware Engine network of type + // `LEGACY` is a regional resource, and a VMware + // Engine network of type `STANDARD` is a global resource. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. For example: + // `projects/my-project/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // Required. The user-provided identifier of the new VMware Engine network. + // This identifier must be unique among VMware Engine network resources + // within the parent and becomes the final token in the name URI. The + // identifier must meet the following requirements: + // + // * For networks of type LEGACY, adheres to the format: + // `{region-id}-default`. Replace `{region-id}` with the region where you want + // to create the VMware Engine network. For example, "us-west1-default". + // * Only contains 1-63 alphanumeric characters and hyphens + // * Begins with an alphabetical character + // * Ends with a non-hyphen character + // * Not formatted as a UUID + // * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + // (section 3.5) + string vmware_engine_network_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The initial description of the new VMware Engine network. + VmwareEngineNetwork vmware_engine_network = 3 [(google.api.field_behavior) = REQUIRED]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.UpdateVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork] +message UpdateVmwareEngineNetworkRequest { + // Required. VMware Engine network description. + VmwareEngineNetwork vmware_engine_network = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Field mask is used to specify the fields to be overwritten in the + // VMware Engine network 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. Only the + // following fields can be updated: `description`. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.DeleteVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork] +message DeleteVmwareEngineNetworkRequest { + // Required. The resource name of the VMware Engine network to be deleted. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; + + // 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 guarantees that a + // request doesn't result in creation of duplicate commitments for at least 60 + // minutes. + // + // For example, consider a situation where you make an initial request and the + // 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]; + + // Optional. Checksum used to ensure that the user-provided value is up to date before + // the server processes the request. The server compares provided checksum + // with the current checksum of the resource. If the user-provided value is + // out of date, this request returns an `ABORTED` error. + string etag = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [VmwareEngine.GetVmwareEngineNetwork][google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork] +message GetVmwareEngineNetworkRequest { + // Required. The resource name of the VMware Engine network to retrieve. + // Resource names are schemeless URIs that follow the conventions in + // https://cloud.google.com/apis/design/resource_names. + // For example: + // `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + ]; +} + +// Request message for [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks] +message ListVmwareEngineNetworksRequest { + // Required. The resource name of the location to query for + // VMware Engine networks. Resource names are schemeless URIs that follow the + // conventions in https://cloud.google.com/apis/design/resource_names. For + // example: `projects/my-project/locations/global` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of results to return in one page. + // The maximum value is coerced to 1000. + // The default value of this field is 500. + int32 page_size = 2; + + // A page token, received from a previous `ListVmwareEngineNetworks` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListVmwareEngineNetworks` must match the call that provided the page + // token. + string page_token = 3; + + // A filter expression that matches resources returned in the response. + // The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. The value + // must be a string, a number, or a boolean. The comparison operator + // must be `=`, `!=`, `>`, or `<`. + // + // For example, if you are filtering a list of network peerings, you can + // exclude the ones named `example-network` by specifying + // `name != "example-network"`. + // + // To filter on multiple expressions, provide each separate expression within + // parentheses. For example: + // ``` + // (name = "example-network") + // (createTime > "2021-04-12T08:15:10.40Z") + // ``` + // + // By default, each expression is an `AND` expression. However, you + // can include `AND` and `OR` expressions explicitly. + // For example: + // ``` + // (name = "example-network-1") AND + // (createTime > "2021-04-12T08:15:10.40Z") OR + // (name = "example-network-2") + // ``` + string filter = 4; + + // Sorts list results by a certain order. By default, returned results + // are ordered by `name` in ascending order. + // You can also sort results in descending order based on the `name` value + // using `orderBy="name desc"`. + // Currently, only ordering by `name` is supported. + string order_by = 5; +} + +// Response message for [VmwareEngine.ListVmwareEngineNetworks][google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks] +message ListVmwareEngineNetworksResponse { + // A list of VMware Engine networks. + repeated VmwareEngineNetwork vmware_engine_networks = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // Unreachable resources. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-vmwareengine/protos/protos.d.ts b/packages/google-cloud-vmwareengine/protos/protos.d.ts new file mode 100644 index 00000000000..11afddcacbc --- /dev/null +++ b/packages/google-cloud-vmwareengine/protos/protos.d.ts @@ -0,0 +1,12597 @@ +// 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 vmwareengine. */ + namespace vmwareengine { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a VmwareEngine */ + class VmwareEngine extends $protobuf.rpc.Service { + + /** + * Constructs a new VmwareEngine 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 VmwareEngine 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): VmwareEngine; + + /** + * Calls ListPrivateClouds. + * @param request ListPrivateCloudsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListPrivateCloudsResponse + */ + public listPrivateClouds(request: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateCloudsCallback): void; + + /** + * Calls ListPrivateClouds. + * @param request ListPrivateCloudsRequest message or plain object + * @returns Promise + */ + public listPrivateClouds(request: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest): Promise; + + /** + * Calls GetPrivateCloud. + * @param request GetPrivateCloudRequest message or plain object + * @param callback Node-style callback called with the error, if any, and PrivateCloud + */ + public getPrivateCloud(request: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloudCallback): void; + + /** + * Calls GetPrivateCloud. + * @param request GetPrivateCloudRequest message or plain object + * @returns Promise + */ + public getPrivateCloud(request: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest): Promise; + + /** + * Calls CreatePrivateCloud. + * @param request CreatePrivateCloudRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createPrivateCloud(request: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloudCallback): void; + + /** + * Calls CreatePrivateCloud. + * @param request CreatePrivateCloudRequest message or plain object + * @returns Promise + */ + public createPrivateCloud(request: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest): Promise; + + /** + * Calls UpdatePrivateCloud. + * @param request UpdatePrivateCloudRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updatePrivateCloud(request: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloudCallback): void; + + /** + * Calls UpdatePrivateCloud. + * @param request UpdatePrivateCloudRequest message or plain object + * @returns Promise + */ + public updatePrivateCloud(request: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest): Promise; + + /** + * Calls DeletePrivateCloud. + * @param request DeletePrivateCloudRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deletePrivateCloud(request: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloudCallback): void; + + /** + * Calls DeletePrivateCloud. + * @param request DeletePrivateCloudRequest message or plain object + * @returns Promise + */ + public deletePrivateCloud(request: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest): Promise; + + /** + * Calls UndeletePrivateCloud. + * @param request UndeletePrivateCloudRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public undeletePrivateCloud(request: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloudCallback): void; + + /** + * Calls UndeletePrivateCloud. + * @param request UndeletePrivateCloudRequest message or plain object + * @returns Promise + */ + public undeletePrivateCloud(request: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest): Promise; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListClustersResponse + */ + public listClusters(request: google.cloud.vmwareengine.v1.IListClustersRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListClustersCallback): void; + + /** + * Calls ListClusters. + * @param request ListClustersRequest message or plain object + * @returns Promise + */ + public listClusters(request: google.cloud.vmwareengine.v1.IListClustersRequest): Promise; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Cluster + */ + public getCluster(request: google.cloud.vmwareengine.v1.IGetClusterRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetClusterCallback): void; + + /** + * Calls GetCluster. + * @param request GetClusterRequest message or plain object + * @returns Promise + */ + public getCluster(request: google.cloud.vmwareengine.v1.IGetClusterRequest): Promise; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createCluster(request: google.cloud.vmwareengine.v1.ICreateClusterRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreateClusterCallback): void; + + /** + * Calls CreateCluster. + * @param request CreateClusterRequest message or plain object + * @returns Promise + */ + public createCluster(request: google.cloud.vmwareengine.v1.ICreateClusterRequest): Promise; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateCluster(request: google.cloud.vmwareengine.v1.IUpdateClusterRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdateClusterCallback): void; + + /** + * Calls UpdateCluster. + * @param request UpdateClusterRequest message or plain object + * @returns Promise + */ + public updateCluster(request: google.cloud.vmwareengine.v1.IUpdateClusterRequest): Promise; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteCluster(request: google.cloud.vmwareengine.v1.IDeleteClusterRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.DeleteClusterCallback): void; + + /** + * Calls DeleteCluster. + * @param request DeleteClusterRequest message or plain object + * @returns Promise + */ + public deleteCluster(request: google.cloud.vmwareengine.v1.IDeleteClusterRequest): Promise; + + /** + * Calls ListSubnets. + * @param request ListSubnetsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSubnetsResponse + */ + public listSubnets(request: google.cloud.vmwareengine.v1.IListSubnetsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListSubnetsCallback): void; + + /** + * Calls ListSubnets. + * @param request ListSubnetsRequest message or plain object + * @returns Promise + */ + public listSubnets(request: google.cloud.vmwareengine.v1.IListSubnetsRequest): Promise; + + /** + * Calls ListNodeTypes. + * @param request ListNodeTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNodeTypesResponse + */ + public listNodeTypes(request: google.cloud.vmwareengine.v1.IListNodeTypesRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypesCallback): void; + + /** + * Calls ListNodeTypes. + * @param request ListNodeTypesRequest message or plain object + * @returns Promise + */ + public listNodeTypes(request: google.cloud.vmwareengine.v1.IListNodeTypesRequest): Promise; + + /** + * Calls GetNodeType. + * @param request GetNodeTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NodeType + */ + public getNodeType(request: google.cloud.vmwareengine.v1.IGetNodeTypeRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetNodeTypeCallback): void; + + /** + * Calls GetNodeType. + * @param request GetNodeTypeRequest message or plain object + * @returns Promise + */ + public getNodeType(request: google.cloud.vmwareengine.v1.IGetNodeTypeRequest): Promise; + + /** + * Calls ShowNsxCredentials. + * @param request ShowNsxCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Credentials + */ + public showNsxCredentials(request: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentialsCallback): void; + + /** + * Calls ShowNsxCredentials. + * @param request ShowNsxCredentialsRequest message or plain object + * @returns Promise + */ + public showNsxCredentials(request: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest): Promise; + + /** + * Calls ShowVcenterCredentials. + * @param request ShowVcenterCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Credentials + */ + public showVcenterCredentials(request: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentialsCallback): void; + + /** + * Calls ShowVcenterCredentials. + * @param request ShowVcenterCredentialsRequest message or plain object + * @returns Promise + */ + public showVcenterCredentials(request: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest): Promise; + + /** + * Calls ResetNsxCredentials. + * @param request ResetNsxCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resetNsxCredentials(request: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentialsCallback): void; + + /** + * Calls ResetNsxCredentials. + * @param request ResetNsxCredentialsRequest message or plain object + * @returns Promise + */ + public resetNsxCredentials(request: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest): Promise; + + /** + * Calls ResetVcenterCredentials. + * @param request ResetVcenterCredentialsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public resetVcenterCredentials(request: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentialsCallback): void; + + /** + * Calls ResetVcenterCredentials. + * @param request ResetVcenterCredentialsRequest message or plain object + * @returns Promise + */ + public resetVcenterCredentials(request: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest): Promise; + + /** + * Calls CreateHcxActivationKey. + * @param request CreateHcxActivationKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createHcxActivationKey(request: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKeyCallback): void; + + /** + * Calls CreateHcxActivationKey. + * @param request CreateHcxActivationKeyRequest message or plain object + * @returns Promise + */ + public createHcxActivationKey(request: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest): Promise; + + /** + * Calls ListHcxActivationKeys. + * @param request ListHcxActivationKeysRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListHcxActivationKeysResponse + */ + public listHcxActivationKeys(request: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeysCallback): void; + + /** + * Calls ListHcxActivationKeys. + * @param request ListHcxActivationKeysRequest message or plain object + * @returns Promise + */ + public listHcxActivationKeys(request: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest): Promise; + + /** + * Calls GetHcxActivationKey. + * @param request GetHcxActivationKeyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and HcxActivationKey + */ + public getHcxActivationKey(request: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKeyCallback): void; + + /** + * Calls GetHcxActivationKey. + * @param request GetHcxActivationKeyRequest message or plain object + * @returns Promise + */ + public getHcxActivationKey(request: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest): Promise; + + /** + * Calls GetNetworkPolicy. + * @param request GetNetworkPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and NetworkPolicy + */ + public getNetworkPolicy(request: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicyCallback): void; + + /** + * Calls GetNetworkPolicy. + * @param request GetNetworkPolicyRequest message or plain object + * @returns Promise + */ + public getNetworkPolicy(request: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest): Promise; + + /** + * Calls ListNetworkPolicies. + * @param request ListNetworkPoliciesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNetworkPoliciesResponse + */ + public listNetworkPolicies(request: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPoliciesCallback): void; + + /** + * Calls ListNetworkPolicies. + * @param request ListNetworkPoliciesRequest message or plain object + * @returns Promise + */ + public listNetworkPolicies(request: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest): Promise; + + /** + * Calls CreateNetworkPolicy. + * @param request CreateNetworkPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createNetworkPolicy(request: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicyCallback): void; + + /** + * Calls CreateNetworkPolicy. + * @param request CreateNetworkPolicyRequest message or plain object + * @returns Promise + */ + public createNetworkPolicy(request: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest): Promise; + + /** + * Calls UpdateNetworkPolicy. + * @param request UpdateNetworkPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateNetworkPolicy(request: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicyCallback): void; + + /** + * Calls UpdateNetworkPolicy. + * @param request UpdateNetworkPolicyRequest message or plain object + * @returns Promise + */ + public updateNetworkPolicy(request: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest): Promise; + + /** + * Calls DeleteNetworkPolicy. + * @param request DeleteNetworkPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteNetworkPolicy(request: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicyCallback): void; + + /** + * Calls DeleteNetworkPolicy. + * @param request DeleteNetworkPolicyRequest message or plain object + * @returns Promise + */ + public deleteNetworkPolicy(request: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest): Promise; + + /** + * Calls CreateVmwareEngineNetwork. + * @param request CreateVmwareEngineNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetworkCallback): void; + + /** + * Calls CreateVmwareEngineNetwork. + * @param request CreateVmwareEngineNetworkRequest message or plain object + * @returns Promise + */ + public createVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest): Promise; + + /** + * Calls UpdateVmwareEngineNetwork. + * @param request UpdateVmwareEngineNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetworkCallback): void; + + /** + * Calls UpdateVmwareEngineNetwork. + * @param request UpdateVmwareEngineNetworkRequest message or plain object + * @returns Promise + */ + public updateVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest): Promise; + + /** + * Calls DeleteVmwareEngineNetwork. + * @param request DeleteVmwareEngineNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetworkCallback): void; + + /** + * Calls DeleteVmwareEngineNetwork. + * @param request DeleteVmwareEngineNetworkRequest message or plain object + * @returns Promise + */ + public deleteVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest): Promise; + + /** + * Calls GetVmwareEngineNetwork. + * @param request GetVmwareEngineNetworkRequest message or plain object + * @param callback Node-style callback called with the error, if any, and VmwareEngineNetwork + */ + public getVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetworkCallback): void; + + /** + * Calls GetVmwareEngineNetwork. + * @param request GetVmwareEngineNetworkRequest message or plain object + * @returns Promise + */ + public getVmwareEngineNetwork(request: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest): Promise; + + /** + * Calls ListVmwareEngineNetworks. + * @param request ListVmwareEngineNetworksRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListVmwareEngineNetworksResponse + */ + public listVmwareEngineNetworks(request: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, callback: google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworksCallback): void; + + /** + * Calls ListVmwareEngineNetworks. + * @param request ListVmwareEngineNetworksRequest message or plain object + * @returns Promise + */ + public listVmwareEngineNetworks(request: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest): Promise; + } + + namespace VmwareEngine { + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateClouds}. + * @param error Error, if any + * @param [response] ListPrivateCloudsResponse + */ + type ListPrivateCloudsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListPrivateCloudsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getPrivateCloud}. + * @param error Error, if any + * @param [response] PrivateCloud + */ + type GetPrivateCloudCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.PrivateCloud) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createPrivateCloud}. + * @param error Error, if any + * @param [response] Operation + */ + type CreatePrivateCloudCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updatePrivateCloud}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdatePrivateCloudCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deletePrivateCloud}. + * @param error Error, if any + * @param [response] Operation + */ + type DeletePrivateCloudCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|undeletePrivateCloud}. + * @param error Error, if any + * @param [response] Operation + */ + type UndeletePrivateCloudCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listClusters}. + * @param error Error, if any + * @param [response] ListClustersResponse + */ + type ListClustersCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListClustersResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getCluster}. + * @param error Error, if any + * @param [response] Cluster + */ + type GetClusterCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.Cluster) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteCluster}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteClusterCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listSubnets}. + * @param error Error, if any + * @param [response] ListSubnetsResponse + */ + type ListSubnetsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListSubnetsResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNodeTypes}. + * @param error Error, if any + * @param [response] ListNodeTypesResponse + */ + type ListNodeTypesCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListNodeTypesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getNodeType}. + * @param error Error, if any + * @param [response] NodeType + */ + type GetNodeTypeCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.NodeType) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|showNsxCredentials}. + * @param error Error, if any + * @param [response] Credentials + */ + type ShowNsxCredentialsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.Credentials) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|showVcenterCredentials}. + * @param error Error, if any + * @param [response] Credentials + */ + type ShowVcenterCredentialsCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.Credentials) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|resetNsxCredentials}. + * @param error Error, if any + * @param [response] Operation + */ + type ResetNsxCredentialsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|resetVcenterCredentials}. + * @param error Error, if any + * @param [response] Operation + */ + type ResetVcenterCredentialsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createHcxActivationKey}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateHcxActivationKeyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listHcxActivationKeys}. + * @param error Error, if any + * @param [response] ListHcxActivationKeysResponse + */ + type ListHcxActivationKeysCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getHcxActivationKey}. + * @param error Error, if any + * @param [response] HcxActivationKey + */ + type GetHcxActivationKeyCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.HcxActivationKey) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getNetworkPolicy}. + * @param error Error, if any + * @param [response] NetworkPolicy + */ + type GetNetworkPolicyCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.NetworkPolicy) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNetworkPolicies}. + * @param error Error, if any + * @param [response] ListNetworkPoliciesResponse + */ + type ListNetworkPoliciesCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createNetworkPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateNetworkPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateNetworkPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateNetworkPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteNetworkPolicy}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteNetworkPolicyCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createVmwareEngineNetwork}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateVmwareEngineNetworkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateVmwareEngineNetwork}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateVmwareEngineNetworkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteVmwareEngineNetwork}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteVmwareEngineNetworkCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getVmwareEngineNetwork}. + * @param error Error, if any + * @param [response] VmwareEngineNetwork + */ + type GetVmwareEngineNetworkCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.VmwareEngineNetwork) => void; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listVmwareEngineNetworks}. + * @param error Error, if any + * @param [response] ListVmwareEngineNetworksResponse + */ + type ListVmwareEngineNetworksCallback = (error: (Error|null), response?: google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig managementCidr */ + managementCidr?: (string|null); + + /** NetworkConfig vmwareEngineNetwork */ + vmwareEngineNetwork?: (string|null); + + /** NetworkConfig vmwareEngineNetworkCanonical */ + vmwareEngineNetworkCanonical?: (string|null); + + /** NetworkConfig managementIpAddressLayoutVersion */ + managementIpAddressLayoutVersion?: (number|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INetworkConfig); + + /** NetworkConfig managementCidr. */ + public managementCidr: string; + + /** NetworkConfig vmwareEngineNetwork. */ + public vmwareEngineNetwork: string; + + /** NetworkConfig vmwareEngineNetworkCanonical. */ + public vmwareEngineNetworkCanonical: string; + + /** NetworkConfig managementIpAddressLayoutVersion. */ + public managementIpAddressLayoutVersion: number; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.INetworkConfig): google.cloud.vmwareengine.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not 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.vmwareengine.v1.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload 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.vmwareengine.v1.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeTypeConfig. */ + interface INodeTypeConfig { + + /** NodeTypeConfig nodeCount */ + nodeCount?: (number|null); + + /** NodeTypeConfig customCoreCount */ + customCoreCount?: (number|null); + } + + /** Represents a NodeTypeConfig. */ + class NodeTypeConfig implements INodeTypeConfig { + + /** + * Constructs a new NodeTypeConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INodeTypeConfig); + + /** NodeTypeConfig nodeCount. */ + public nodeCount: number; + + /** NodeTypeConfig customCoreCount. */ + public customCoreCount: number; + + /** + * Creates a new NodeTypeConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeTypeConfig instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.INodeTypeConfig): google.cloud.vmwareengine.v1.NodeTypeConfig; + + /** + * Encodes the specified NodeTypeConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @param message NodeTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.INodeTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeTypeConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @param message NodeTypeConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.INodeTypeConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeTypeConfig + * @throws {Error} If the payload is not 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.vmwareengine.v1.NodeTypeConfig; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeTypeConfig + * @throws {Error} If the payload 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.vmwareengine.v1.NodeTypeConfig; + + /** + * Verifies a NodeTypeConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeTypeConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeTypeConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.NodeTypeConfig; + + /** + * Creates a plain object from a NodeTypeConfig message. Also converts values to other types if specified. + * @param message NodeTypeConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.NodeTypeConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeTypeConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeTypeConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PrivateCloud. */ + interface IPrivateCloud { + + /** PrivateCloud name */ + name?: (string|null); + + /** PrivateCloud createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud deleteTime */ + deleteTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud state */ + state?: (google.cloud.vmwareengine.v1.PrivateCloud.State|keyof typeof google.cloud.vmwareengine.v1.PrivateCloud.State|null); + + /** PrivateCloud networkConfig */ + networkConfig?: (google.cloud.vmwareengine.v1.INetworkConfig|null); + + /** PrivateCloud managementCluster */ + managementCluster?: (google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null); + + /** PrivateCloud description */ + description?: (string|null); + + /** PrivateCloud hcx */ + hcx?: (google.cloud.vmwareengine.v1.IHcx|null); + + /** PrivateCloud nsx */ + nsx?: (google.cloud.vmwareengine.v1.INsx|null); + + /** PrivateCloud vcenter */ + vcenter?: (google.cloud.vmwareengine.v1.IVcenter|null); + + /** PrivateCloud uid */ + uid?: (string|null); + } + + /** Represents a PrivateCloud. */ + class PrivateCloud implements IPrivateCloud { + + /** + * Constructs a new PrivateCloud. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IPrivateCloud); + + /** PrivateCloud name. */ + public name: string; + + /** PrivateCloud createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud deleteTime. */ + public deleteTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** PrivateCloud state. */ + public state: (google.cloud.vmwareengine.v1.PrivateCloud.State|keyof typeof google.cloud.vmwareengine.v1.PrivateCloud.State); + + /** PrivateCloud networkConfig. */ + public networkConfig?: (google.cloud.vmwareengine.v1.INetworkConfig|null); + + /** PrivateCloud managementCluster. */ + public managementCluster?: (google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null); + + /** PrivateCloud description. */ + public description: string; + + /** PrivateCloud hcx. */ + public hcx?: (google.cloud.vmwareengine.v1.IHcx|null); + + /** PrivateCloud nsx. */ + public nsx?: (google.cloud.vmwareengine.v1.INsx|null); + + /** PrivateCloud vcenter. */ + public vcenter?: (google.cloud.vmwareengine.v1.IVcenter|null); + + /** PrivateCloud uid. */ + public uid: string; + + /** + * Creates a new PrivateCloud instance using the specified properties. + * @param [properties] Properties to set + * @returns PrivateCloud instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IPrivateCloud): google.cloud.vmwareengine.v1.PrivateCloud; + + /** + * Encodes the specified PrivateCloud message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @param message PrivateCloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IPrivateCloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PrivateCloud message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @param message PrivateCloud message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IPrivateCloud, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PrivateCloud + * @throws {Error} If the payload is not 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.vmwareengine.v1.PrivateCloud; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PrivateCloud + * @throws {Error} If the payload 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.vmwareengine.v1.PrivateCloud; + + /** + * Verifies a PrivateCloud message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PrivateCloud message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PrivateCloud + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.PrivateCloud; + + /** + * Creates a plain object from a PrivateCloud message. Also converts values to other types if specified. + * @param message PrivateCloud + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.PrivateCloud, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PrivateCloud to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PrivateCloud + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace PrivateCloud { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + UPDATING = 3, + FAILED = 5, + DELETED = 6, + PURGING = 7 + } + + /** Properties of a ManagementCluster. */ + interface IManagementCluster { + + /** ManagementCluster clusterId */ + clusterId?: (string|null); + + /** ManagementCluster nodeTypeConfigs */ + nodeTypeConfigs?: ({ [k: string]: google.cloud.vmwareengine.v1.INodeTypeConfig }|null); + } + + /** Represents a ManagementCluster. */ + class ManagementCluster implements IManagementCluster { + + /** + * Constructs a new ManagementCluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster); + + /** ManagementCluster clusterId. */ + public clusterId: string; + + /** ManagementCluster nodeTypeConfigs. */ + public nodeTypeConfigs: { [k: string]: google.cloud.vmwareengine.v1.INodeTypeConfig }; + + /** + * Creates a new ManagementCluster instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementCluster instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster): google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster; + + /** + * Encodes the specified ManagementCluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @param message ManagementCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementCluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @param message ManagementCluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementCluster + * @throws {Error} If the payload is not 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.vmwareengine.v1.PrivateCloud.ManagementCluster; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementCluster + * @throws {Error} If the payload 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.vmwareengine.v1.PrivateCloud.ManagementCluster; + + /** + * Verifies a ManagementCluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementCluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementCluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster; + + /** + * Creates a plain object from a ManagementCluster message. Also converts values to other types if specified. + * @param message ManagementCluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementCluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementCluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a ListPrivateCloudsRequest. */ + interface IListPrivateCloudsRequest { + + /** ListPrivateCloudsRequest parent */ + parent?: (string|null); + + /** ListPrivateCloudsRequest pageSize */ + pageSize?: (number|null); + + /** ListPrivateCloudsRequest pageToken */ + pageToken?: (string|null); + + /** ListPrivateCloudsRequest filter */ + filter?: (string|null); + + /** ListPrivateCloudsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListPrivateCloudsRequest. */ + class ListPrivateCloudsRequest implements IListPrivateCloudsRequest { + + /** + * Constructs a new ListPrivateCloudsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest); + + /** ListPrivateCloudsRequest parent. */ + public parent: string; + + /** ListPrivateCloudsRequest pageSize. */ + public pageSize: number; + + /** ListPrivateCloudsRequest pageToken. */ + public pageToken: string; + + /** ListPrivateCloudsRequest filter. */ + public filter: string; + + /** ListPrivateCloudsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListPrivateCloudsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateCloudsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest): google.cloud.vmwareengine.v1.ListPrivateCloudsRequest; + + /** + * Encodes the specified ListPrivateCloudsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsRequest.verify|verify} messages. + * @param message ListPrivateCloudsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateCloudsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsRequest.verify|verify} messages. + * @param message ListPrivateCloudsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateCloudsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateCloudsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListPrivateCloudsRequest; + + /** + * Decodes a ListPrivateCloudsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateCloudsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListPrivateCloudsRequest; + + /** + * Verifies a ListPrivateCloudsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateCloudsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateCloudsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateCloudsRequest; + + /** + * Creates a plain object from a ListPrivateCloudsRequest message. Also converts values to other types if specified. + * @param message ListPrivateCloudsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateCloudsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateCloudsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateCloudsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListPrivateCloudsResponse. */ + interface IListPrivateCloudsResponse { + + /** ListPrivateCloudsResponse privateClouds */ + privateClouds?: (google.cloud.vmwareengine.v1.IPrivateCloud[]|null); + + /** ListPrivateCloudsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListPrivateCloudsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListPrivateCloudsResponse. */ + class ListPrivateCloudsResponse implements IListPrivateCloudsResponse { + + /** + * Constructs a new ListPrivateCloudsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListPrivateCloudsResponse); + + /** ListPrivateCloudsResponse privateClouds. */ + public privateClouds: google.cloud.vmwareengine.v1.IPrivateCloud[]; + + /** ListPrivateCloudsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListPrivateCloudsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListPrivateCloudsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListPrivateCloudsResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListPrivateCloudsResponse): google.cloud.vmwareengine.v1.ListPrivateCloudsResponse; + + /** + * Encodes the specified ListPrivateCloudsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.verify|verify} messages. + * @param message ListPrivateCloudsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListPrivateCloudsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListPrivateCloudsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.verify|verify} messages. + * @param message ListPrivateCloudsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListPrivateCloudsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListPrivateCloudsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListPrivateCloudsResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListPrivateCloudsResponse; + + /** + * Decodes a ListPrivateCloudsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListPrivateCloudsResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListPrivateCloudsResponse; + + /** + * Verifies a ListPrivateCloudsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListPrivateCloudsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListPrivateCloudsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListPrivateCloudsResponse; + + /** + * Creates a plain object from a ListPrivateCloudsResponse message. Also converts values to other types if specified. + * @param message ListPrivateCloudsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListPrivateCloudsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListPrivateCloudsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListPrivateCloudsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetPrivateCloudRequest. */ + interface IGetPrivateCloudRequest { + + /** GetPrivateCloudRequest name */ + name?: (string|null); + } + + /** Represents a GetPrivateCloudRequest. */ + class GetPrivateCloudRequest implements IGetPrivateCloudRequest { + + /** + * Constructs a new GetPrivateCloudRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest); + + /** GetPrivateCloudRequest name. */ + public name: string; + + /** + * Creates a new GetPrivateCloudRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetPrivateCloudRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest): google.cloud.vmwareengine.v1.GetPrivateCloudRequest; + + /** + * Encodes the specified GetPrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateCloudRequest.verify|verify} messages. + * @param message GetPrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetPrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateCloudRequest.verify|verify} messages. + * @param message GetPrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetPrivateCloudRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetPrivateCloudRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetPrivateCloudRequest; + + /** + * Decodes a GetPrivateCloudRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetPrivateCloudRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetPrivateCloudRequest; + + /** + * Verifies a GetPrivateCloudRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetPrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetPrivateCloudRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetPrivateCloudRequest; + + /** + * Creates a plain object from a GetPrivateCloudRequest message. Also converts values to other types if specified. + * @param message GetPrivateCloudRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetPrivateCloudRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetPrivateCloudRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetPrivateCloudRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreatePrivateCloudRequest. */ + interface ICreatePrivateCloudRequest { + + /** CreatePrivateCloudRequest parent */ + parent?: (string|null); + + /** CreatePrivateCloudRequest privateCloudId */ + privateCloudId?: (string|null); + + /** CreatePrivateCloudRequest privateCloud */ + privateCloud?: (google.cloud.vmwareengine.v1.IPrivateCloud|null); + + /** CreatePrivateCloudRequest requestId */ + requestId?: (string|null); + + /** CreatePrivateCloudRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreatePrivateCloudRequest. */ + class CreatePrivateCloudRequest implements ICreatePrivateCloudRequest { + + /** + * Constructs a new CreatePrivateCloudRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest); + + /** CreatePrivateCloudRequest parent. */ + public parent: string; + + /** CreatePrivateCloudRequest privateCloudId. */ + public privateCloudId: string; + + /** CreatePrivateCloudRequest privateCloud. */ + public privateCloud?: (google.cloud.vmwareengine.v1.IPrivateCloud|null); + + /** CreatePrivateCloudRequest requestId. */ + public requestId: string; + + /** CreatePrivateCloudRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreatePrivateCloudRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreatePrivateCloudRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest): google.cloud.vmwareengine.v1.CreatePrivateCloudRequest; + + /** + * Encodes the specified CreatePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateCloudRequest.verify|verify} messages. + * @param message CreatePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreatePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateCloudRequest.verify|verify} messages. + * @param message CreatePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreatePrivateCloudRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreatePrivateCloudRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.CreatePrivateCloudRequest; + + /** + * Decodes a CreatePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreatePrivateCloudRequest + * @throws {Error} If the payload 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.vmwareengine.v1.CreatePrivateCloudRequest; + + /** + * Verifies a CreatePrivateCloudRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreatePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreatePrivateCloudRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreatePrivateCloudRequest; + + /** + * Creates a plain object from a CreatePrivateCloudRequest message. Also converts values to other types if specified. + * @param message CreatePrivateCloudRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreatePrivateCloudRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreatePrivateCloudRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreatePrivateCloudRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdatePrivateCloudRequest. */ + interface IUpdatePrivateCloudRequest { + + /** UpdatePrivateCloudRequest privateCloud */ + privateCloud?: (google.cloud.vmwareengine.v1.IPrivateCloud|null); + + /** UpdatePrivateCloudRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePrivateCloudRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdatePrivateCloudRequest. */ + class UpdatePrivateCloudRequest implements IUpdatePrivateCloudRequest { + + /** + * Constructs a new UpdatePrivateCloudRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest); + + /** UpdatePrivateCloudRequest privateCloud. */ + public privateCloud?: (google.cloud.vmwareengine.v1.IPrivateCloud|null); + + /** UpdatePrivateCloudRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdatePrivateCloudRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdatePrivateCloudRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdatePrivateCloudRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest): google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest; + + /** + * Encodes the specified UpdatePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.verify|verify} messages. + * @param message UpdatePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdatePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.verify|verify} messages. + * @param message UpdatePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdatePrivateCloudRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdatePrivateCloudRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.UpdatePrivateCloudRequest; + + /** + * Decodes an UpdatePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdatePrivateCloudRequest + * @throws {Error} If the payload 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.vmwareengine.v1.UpdatePrivateCloudRequest; + + /** + * Verifies an UpdatePrivateCloudRequest message. + * @param message Plain 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 UpdatePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdatePrivateCloudRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest; + + /** + * Creates a plain object from an UpdatePrivateCloudRequest message. Also converts values to other types if specified. + * @param message UpdatePrivateCloudRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdatePrivateCloudRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdatePrivateCloudRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeletePrivateCloudRequest. */ + interface IDeletePrivateCloudRequest { + + /** DeletePrivateCloudRequest name */ + name?: (string|null); + + /** DeletePrivateCloudRequest requestId */ + requestId?: (string|null); + + /** DeletePrivateCloudRequest force */ + force?: (boolean|null); + + /** DeletePrivateCloudRequest delayHours */ + delayHours?: (number|null); + } + + /** Represents a DeletePrivateCloudRequest. */ + class DeletePrivateCloudRequest implements IDeletePrivateCloudRequest { + + /** + * Constructs a new DeletePrivateCloudRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest); + + /** DeletePrivateCloudRequest name. */ + public name: string; + + /** DeletePrivateCloudRequest requestId. */ + public requestId: string; + + /** DeletePrivateCloudRequest force. */ + public force: boolean; + + /** DeletePrivateCloudRequest delayHours. */ + public delayHours?: (number|null); + + /** DeletePrivateCloudRequest _delayHours. */ + public _delayHours?: "delayHours"; + + /** + * Creates a new DeletePrivateCloudRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeletePrivateCloudRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest): google.cloud.vmwareengine.v1.DeletePrivateCloudRequest; + + /** + * Encodes the specified DeletePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateCloudRequest.verify|verify} messages. + * @param message DeletePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeletePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateCloudRequest.verify|verify} messages. + * @param message DeletePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeletePrivateCloudRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeletePrivateCloudRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.DeletePrivateCloudRequest; + + /** + * Decodes a DeletePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeletePrivateCloudRequest + * @throws {Error} If the payload 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.vmwareengine.v1.DeletePrivateCloudRequest; + + /** + * Verifies a DeletePrivateCloudRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeletePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeletePrivateCloudRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.DeletePrivateCloudRequest; + + /** + * Creates a plain object from a DeletePrivateCloudRequest message. Also converts values to other types if specified. + * @param message DeletePrivateCloudRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.DeletePrivateCloudRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeletePrivateCloudRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeletePrivateCloudRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UndeletePrivateCloudRequest. */ + interface IUndeletePrivateCloudRequest { + + /** UndeletePrivateCloudRequest name */ + name?: (string|null); + + /** UndeletePrivateCloudRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UndeletePrivateCloudRequest. */ + class UndeletePrivateCloudRequest implements IUndeletePrivateCloudRequest { + + /** + * Constructs a new UndeletePrivateCloudRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest); + + /** UndeletePrivateCloudRequest name. */ + public name: string; + + /** UndeletePrivateCloudRequest requestId. */ + public requestId: string; + + /** + * Creates a new UndeletePrivateCloudRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UndeletePrivateCloudRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest): google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest; + + /** + * Encodes the specified UndeletePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest.verify|verify} messages. + * @param message UndeletePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UndeletePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest.verify|verify} messages. + * @param message UndeletePrivateCloudRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UndeletePrivateCloudRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UndeletePrivateCloudRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.UndeletePrivateCloudRequest; + + /** + * Decodes an UndeletePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UndeletePrivateCloudRequest + * @throws {Error} If the payload 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.vmwareengine.v1.UndeletePrivateCloudRequest; + + /** + * Verifies an UndeletePrivateCloudRequest message. + * @param message Plain 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 UndeletePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UndeletePrivateCloudRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest; + + /** + * Creates a plain object from an UndeletePrivateCloudRequest message. Also converts values to other types if specified. + * @param message UndeletePrivateCloudRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UndeletePrivateCloudRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UndeletePrivateCloudRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Cluster. */ + interface ICluster { + + /** Cluster name */ + name?: (string|null); + + /** Cluster createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster state */ + state?: (google.cloud.vmwareengine.v1.Cluster.State|keyof typeof google.cloud.vmwareengine.v1.Cluster.State|null); + + /** Cluster management */ + management?: (boolean|null); + + /** Cluster uid */ + uid?: (string|null); + + /** Cluster nodeTypeConfigs */ + nodeTypeConfigs?: ({ [k: string]: google.cloud.vmwareengine.v1.INodeTypeConfig }|null); + } + + /** Represents a Cluster. */ + class Cluster implements ICluster { + + /** + * Constructs a new Cluster. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICluster); + + /** Cluster name. */ + public name: string; + + /** Cluster createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Cluster updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Cluster state. */ + public state: (google.cloud.vmwareengine.v1.Cluster.State|keyof typeof google.cloud.vmwareengine.v1.Cluster.State); + + /** Cluster management. */ + public management: boolean; + + /** Cluster uid. */ + public uid: string; + + /** Cluster nodeTypeConfigs. */ + public nodeTypeConfigs: { [k: string]: google.cloud.vmwareengine.v1.INodeTypeConfig }; + + /** + * Creates a new Cluster instance using the specified properties. + * @param [properties] Properties to set + * @returns Cluster instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICluster): google.cloud.vmwareengine.v1.Cluster; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @param message Cluster message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICluster, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Cluster + * @throws {Error} If the payload is not 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.vmwareengine.v1.Cluster; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Cluster + * @throws {Error} If the payload 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.vmwareengine.v1.Cluster; + + /** + * Verifies a Cluster message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Cluster + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Cluster; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @param message Cluster + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Cluster, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Cluster to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Cluster + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Cluster { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + UPDATING = 3, + DELETING = 4, + REPAIRING = 5 + } + } + + /** Properties of a ListClustersRequest. */ + interface IListClustersRequest { + + /** ListClustersRequest parent */ + parent?: (string|null); + + /** ListClustersRequest pageSize */ + pageSize?: (number|null); + + /** ListClustersRequest pageToken */ + pageToken?: (string|null); + + /** ListClustersRequest filter */ + filter?: (string|null); + + /** ListClustersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListClustersRequest. */ + class ListClustersRequest implements IListClustersRequest { + + /** + * Constructs a new ListClustersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListClustersRequest); + + /** ListClustersRequest parent. */ + public parent: string; + + /** ListClustersRequest pageSize. */ + public pageSize: number; + + /** ListClustersRequest pageToken. */ + public pageToken: string; + + /** ListClustersRequest filter. */ + public filter: string; + + /** ListClustersRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListClustersRequest): google.cloud.vmwareengine.v1.ListClustersRequest; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersRequest.verify|verify} messages. + * @param message ListClustersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListClustersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListClustersRequest; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListClustersRequest; + + /** + * Verifies a ListClustersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListClustersRequest; + + /** + * Creates a plain object from a ListClustersRequest message. Also converts values to other types if specified. + * @param message ListClustersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListClustersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListClustersResponse. */ + interface IListClustersResponse { + + /** ListClustersResponse clusters */ + clusters?: (google.cloud.vmwareengine.v1.ICluster[]|null); + + /** ListClustersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListClustersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListClustersResponse. */ + class ListClustersResponse implements IListClustersResponse { + + /** + * Constructs a new ListClustersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListClustersResponse); + + /** ListClustersResponse clusters. */ + public clusters: google.cloud.vmwareengine.v1.ICluster[]; + + /** ListClustersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListClustersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListClustersResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListClustersResponse): google.cloud.vmwareengine.v1.ListClustersResponse; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersResponse.verify|verify} messages. + * @param message ListClustersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListClustersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListClustersResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListClustersResponse; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListClustersResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListClustersResponse; + + /** + * Verifies a ListClustersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListClustersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListClustersResponse; + + /** + * Creates a plain object from a ListClustersResponse message. Also converts values to other types if specified. + * @param message ListClustersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListClustersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListClustersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListClustersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetClusterRequest. */ + interface IGetClusterRequest { + + /** GetClusterRequest name */ + name?: (string|null); + } + + /** Represents a GetClusterRequest. */ + class GetClusterRequest implements IGetClusterRequest { + + /** + * Constructs a new GetClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetClusterRequest); + + /** GetClusterRequest name. */ + public name: string; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetClusterRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetClusterRequest): google.cloud.vmwareengine.v1.GetClusterRequest; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetClusterRequest.verify|verify} messages. + * @param message GetClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetClusterRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetClusterRequest; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetClusterRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetClusterRequest; + + /** + * Verifies a GetClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetClusterRequest; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @param message GetClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateClusterRequest. */ + interface ICreateClusterRequest { + + /** CreateClusterRequest parent */ + parent?: (string|null); + + /** CreateClusterRequest clusterId */ + clusterId?: (string|null); + + /** CreateClusterRequest cluster */ + cluster?: (google.cloud.vmwareengine.v1.ICluster|null); + + /** CreateClusterRequest requestId */ + requestId?: (string|null); + + /** CreateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateClusterRequest. */ + class CreateClusterRequest implements ICreateClusterRequest { + + /** + * Constructs a new CreateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICreateClusterRequest); + + /** CreateClusterRequest parent. */ + public parent: string; + + /** CreateClusterRequest clusterId. */ + public clusterId: string; + + /** CreateClusterRequest cluster. */ + public cluster?: (google.cloud.vmwareengine.v1.ICluster|null); + + /** CreateClusterRequest requestId. */ + public requestId: string; + + /** CreateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateClusterRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreateClusterRequest): google.cloud.vmwareengine.v1.CreateClusterRequest; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateClusterRequest.verify|verify} messages. + * @param message CreateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateClusterRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.CreateClusterRequest; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateClusterRequest + * @throws {Error} If the payload 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.vmwareengine.v1.CreateClusterRequest; + + /** + * Verifies a CreateClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreateClusterRequest; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @param message CreateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateClusterRequest. */ + interface IUpdateClusterRequest { + + /** UpdateClusterRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster */ + cluster?: (google.cloud.vmwareengine.v1.ICluster|null); + + /** UpdateClusterRequest requestId */ + requestId?: (string|null); + + /** UpdateClusterRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents an UpdateClusterRequest. */ + class UpdateClusterRequest implements IUpdateClusterRequest { + + /** + * Constructs a new UpdateClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdateClusterRequest); + + /** UpdateClusterRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateClusterRequest cluster. */ + public cluster?: (google.cloud.vmwareengine.v1.ICluster|null); + + /** UpdateClusterRequest requestId. */ + public requestId: string; + + /** UpdateClusterRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateClusterRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdateClusterRequest): google.cloud.vmwareengine.v1.UpdateClusterRequest; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateClusterRequest.verify|verify} messages. + * @param message UpdateClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdateClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateClusterRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.UpdateClusterRequest; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateClusterRequest + * @throws {Error} If the payload 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.vmwareengine.v1.UpdateClusterRequest; + + /** + * Verifies an UpdateClusterRequest message. + * @param message Plain 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 UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdateClusterRequest; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @param message UpdateClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdateClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteClusterRequest. */ + interface IDeleteClusterRequest { + + /** DeleteClusterRequest name */ + name?: (string|null); + + /** DeleteClusterRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteClusterRequest. */ + class DeleteClusterRequest implements IDeleteClusterRequest { + + /** + * Constructs a new DeleteClusterRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IDeleteClusterRequest); + + /** DeleteClusterRequest name. */ + public name: string; + + /** DeleteClusterRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteClusterRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IDeleteClusterRequest): google.cloud.vmwareengine.v1.DeleteClusterRequest; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteClusterRequest.verify|verify} messages. + * @param message DeleteClusterRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IDeleteClusterRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteClusterRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.DeleteClusterRequest; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteClusterRequest + * @throws {Error} If the payload 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.vmwareengine.v1.DeleteClusterRequest; + + /** + * Verifies a DeleteClusterRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteClusterRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.DeleteClusterRequest; + + /** + * Creates a plain object from a DeleteClusterRequest message. Also converts values to other types if specified. + * @param message DeleteClusterRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.DeleteClusterRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteClusterRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteClusterRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Subnet. */ + interface ISubnet { + + /** Subnet name */ + name?: (string|null); + + /** Subnet ipCidrRange */ + ipCidrRange?: (string|null); + + /** Subnet gatewayIp */ + gatewayIp?: (string|null); + + /** Subnet type */ + type?: (string|null); + + /** Subnet state */ + state?: (google.cloud.vmwareengine.v1.Subnet.State|keyof typeof google.cloud.vmwareengine.v1.Subnet.State|null); + } + + /** Represents a Subnet. */ + class Subnet implements ISubnet { + + /** + * Constructs a new Subnet. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ISubnet); + + /** Subnet name. */ + public name: string; + + /** Subnet ipCidrRange. */ + public ipCidrRange: string; + + /** Subnet gatewayIp. */ + public gatewayIp: string; + + /** Subnet type. */ + public type: string; + + /** Subnet state. */ + public state: (google.cloud.vmwareengine.v1.Subnet.State|keyof typeof google.cloud.vmwareengine.v1.Subnet.State); + + /** + * Creates a new Subnet instance using the specified properties. + * @param [properties] Properties to set + * @returns Subnet instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ISubnet): google.cloud.vmwareengine.v1.Subnet; + + /** + * Encodes the specified Subnet message. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @param message Subnet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ISubnet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Subnet message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @param message Subnet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ISubnet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Subnet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Subnet + * @throws {Error} If the payload is not 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.vmwareengine.v1.Subnet; + + /** + * Decodes a Subnet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Subnet + * @throws {Error} If the payload 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.vmwareengine.v1.Subnet; + + /** + * Verifies a Subnet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Subnet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Subnet + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Subnet; + + /** + * Creates a plain object from a Subnet message. Also converts values to other types if specified. + * @param message Subnet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Subnet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Subnet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Subnet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Subnet { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2, + UPDATING = 3, + DELETING = 4 + } + } + + /** Properties of a ListSubnetsRequest. */ + interface IListSubnetsRequest { + + /** ListSubnetsRequest parent */ + parent?: (string|null); + + /** ListSubnetsRequest pageSize */ + pageSize?: (number|null); + + /** ListSubnetsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListSubnetsRequest. */ + class ListSubnetsRequest implements IListSubnetsRequest { + + /** + * Constructs a new ListSubnetsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListSubnetsRequest); + + /** ListSubnetsRequest parent. */ + public parent: string; + + /** ListSubnetsRequest pageSize. */ + public pageSize: number; + + /** ListSubnetsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListSubnetsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubnetsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListSubnetsRequest): google.cloud.vmwareengine.v1.ListSubnetsRequest; + + /** + * Encodes the specified ListSubnetsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsRequest.verify|verify} messages. + * @param message ListSubnetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListSubnetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubnetsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsRequest.verify|verify} messages. + * @param message ListSubnetsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListSubnetsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubnetsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubnetsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListSubnetsRequest; + + /** + * Decodes a ListSubnetsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubnetsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListSubnetsRequest; + + /** + * Verifies a ListSubnetsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubnetsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubnetsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListSubnetsRequest; + + /** + * Creates a plain object from a ListSubnetsRequest message. Also converts values to other types if specified. + * @param message ListSubnetsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListSubnetsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubnetsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubnetsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSubnetsResponse. */ + interface IListSubnetsResponse { + + /** ListSubnetsResponse subnets */ + subnets?: (google.cloud.vmwareengine.v1.ISubnet[]|null); + + /** ListSubnetsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSubnetsResponse. */ + class ListSubnetsResponse implements IListSubnetsResponse { + + /** + * Constructs a new ListSubnetsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListSubnetsResponse); + + /** ListSubnetsResponse subnets. */ + public subnets: google.cloud.vmwareengine.v1.ISubnet[]; + + /** ListSubnetsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSubnetsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSubnetsResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListSubnetsResponse): google.cloud.vmwareengine.v1.ListSubnetsResponse; + + /** + * Encodes the specified ListSubnetsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsResponse.verify|verify} messages. + * @param message ListSubnetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListSubnetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSubnetsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsResponse.verify|verify} messages. + * @param message ListSubnetsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListSubnetsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSubnetsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSubnetsResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListSubnetsResponse; + + /** + * Decodes a ListSubnetsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSubnetsResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListSubnetsResponse; + + /** + * Verifies a ListSubnetsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSubnetsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSubnetsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListSubnetsResponse; + + /** + * Creates a plain object from a ListSubnetsResponse message. Also converts values to other types if specified. + * @param message ListSubnetsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListSubnetsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSubnetsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSubnetsResponse + * @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.vmwareengine.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.vmwareengine.v1.IOperationMetadata): google.cloud.vmwareengine.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmwareengine.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.vmwareengine.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.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 NodeType. */ + interface INodeType { + + /** NodeType name */ + name?: (string|null); + + /** NodeType nodeTypeId */ + nodeTypeId?: (string|null); + + /** NodeType displayName */ + displayName?: (string|null); + + /** NodeType virtualCpuCount */ + virtualCpuCount?: (number|null); + + /** NodeType totalCoreCount */ + totalCoreCount?: (number|null); + + /** NodeType memoryGb */ + memoryGb?: (number|null); + + /** NodeType diskSizeGb */ + diskSizeGb?: (number|null); + + /** NodeType availableCustomCoreCounts */ + availableCustomCoreCounts?: (number[]|null); + } + + /** Represents a NodeType. */ + class NodeType implements INodeType { + + /** + * Constructs a new NodeType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INodeType); + + /** NodeType name. */ + public name: string; + + /** NodeType nodeTypeId. */ + public nodeTypeId: string; + + /** NodeType displayName. */ + public displayName: string; + + /** NodeType virtualCpuCount. */ + public virtualCpuCount: number; + + /** NodeType totalCoreCount. */ + public totalCoreCount: number; + + /** NodeType memoryGb. */ + public memoryGb: number; + + /** NodeType diskSizeGb. */ + public diskSizeGb: number; + + /** NodeType availableCustomCoreCounts. */ + public availableCustomCoreCounts: number[]; + + /** + * Creates a new NodeType instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeType instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.INodeType): google.cloud.vmwareengine.v1.NodeType; + + /** + * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @param message NodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.INodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @param message NodeType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.INodeType, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeType + * @throws {Error} If the payload is not 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.vmwareengine.v1.NodeType; + + /** + * Decodes a NodeType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeType + * @throws {Error} If the payload 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.vmwareengine.v1.NodeType; + + /** + * Verifies a NodeType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.NodeType; + + /** + * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * @param message NodeType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.NodeType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeType + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNodeTypesRequest. */ + interface IListNodeTypesRequest { + + /** ListNodeTypesRequest parent */ + parent?: (string|null); + + /** ListNodeTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListNodeTypesRequest pageToken */ + pageToken?: (string|null); + + /** ListNodeTypesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListNodeTypesRequest. */ + class ListNodeTypesRequest implements IListNodeTypesRequest { + + /** + * Constructs a new ListNodeTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListNodeTypesRequest); + + /** ListNodeTypesRequest parent. */ + public parent: string; + + /** ListNodeTypesRequest pageSize. */ + public pageSize: number; + + /** ListNodeTypesRequest pageToken. */ + public pageToken: string; + + /** ListNodeTypesRequest filter. */ + public filter: string; + + /** + * Creates a new ListNodeTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodeTypesRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListNodeTypesRequest): google.cloud.vmwareengine.v1.ListNodeTypesRequest; + + /** + * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * @param message ListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * @param message ListNodeTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListNodeTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodeTypesRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListNodeTypesRequest; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodeTypesRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListNodeTypesRequest; + + /** + * Verifies a ListNodeTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodeTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListNodeTypesRequest; + + /** + * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. + * @param message ListNodeTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListNodeTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodeTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNodeTypesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNodeTypesResponse. */ + interface IListNodeTypesResponse { + + /** ListNodeTypesResponse nodeTypes */ + nodeTypes?: (google.cloud.vmwareengine.v1.INodeType[]|null); + + /** ListNodeTypesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListNodeTypesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListNodeTypesResponse. */ + class ListNodeTypesResponse implements IListNodeTypesResponse { + + /** + * Constructs a new ListNodeTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListNodeTypesResponse); + + /** ListNodeTypesResponse nodeTypes. */ + public nodeTypes: google.cloud.vmwareengine.v1.INodeType[]; + + /** ListNodeTypesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListNodeTypesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListNodeTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNodeTypesResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListNodeTypesResponse): google.cloud.vmwareengine.v1.ListNodeTypesResponse; + + /** + * Encodes the specified ListNodeTypesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * @param message ListNodeTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListNodeTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNodeTypesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * @param message ListNodeTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListNodeTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNodeTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNodeTypesResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListNodeTypesResponse; + + /** + * Decodes a ListNodeTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNodeTypesResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListNodeTypesResponse; + + /** + * Verifies a ListNodeTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNodeTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNodeTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListNodeTypesResponse; + + /** + * Creates a plain object from a ListNodeTypesResponse message. Also converts values to other types if specified. + * @param message ListNodeTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListNodeTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNodeTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNodeTypesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNodeTypeRequest. */ + interface IGetNodeTypeRequest { + + /** GetNodeTypeRequest name */ + name?: (string|null); + } + + /** Represents a GetNodeTypeRequest. */ + class GetNodeTypeRequest implements IGetNodeTypeRequest { + + /** + * Constructs a new GetNodeTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetNodeTypeRequest); + + /** GetNodeTypeRequest name. */ + public name: string; + + /** + * Creates a new GetNodeTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNodeTypeRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetNodeTypeRequest): google.cloud.vmwareengine.v1.GetNodeTypeRequest; + + /** + * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * @param message GetNodeTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetNodeTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * @param message GetNodeTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetNodeTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNodeTypeRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetNodeTypeRequest; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNodeTypeRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetNodeTypeRequest; + + /** + * Verifies a GetNodeTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNodeTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetNodeTypeRequest; + + /** + * Creates a plain object from a GetNodeTypeRequest message. Also converts values to other types if specified. + * @param message GetNodeTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetNodeTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNodeTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNodeTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Credentials. */ + interface ICredentials { + + /** Credentials username */ + username?: (string|null); + + /** Credentials password */ + password?: (string|null); + } + + /** Represents a Credentials. */ + class Credentials implements ICredentials { + + /** + * Constructs a new Credentials. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICredentials); + + /** Credentials username. */ + public username: string; + + /** Credentials password. */ + public password: string; + + /** + * Creates a new Credentials instance using the specified properties. + * @param [properties] Properties to set + * @returns Credentials instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICredentials): google.cloud.vmwareengine.v1.Credentials; + + /** + * Encodes the specified Credentials message. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * @param message Credentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Credentials message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * @param message Credentials message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICredentials, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Credentials message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Credentials + * @throws {Error} If the payload is not 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.vmwareengine.v1.Credentials; + + /** + * Decodes a Credentials message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Credentials + * @throws {Error} If the payload 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.vmwareengine.v1.Credentials; + + /** + * Verifies a Credentials message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Credentials message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Credentials + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Credentials; + + /** + * Creates a plain object from a Credentials message. Also converts values to other types if specified. + * @param message Credentials + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Credentials, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Credentials to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Credentials + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShowNsxCredentialsRequest. */ + interface IShowNsxCredentialsRequest { + + /** ShowNsxCredentialsRequest privateCloud */ + privateCloud?: (string|null); + } + + /** Represents a ShowNsxCredentialsRequest. */ + class ShowNsxCredentialsRequest implements IShowNsxCredentialsRequest { + + /** + * Constructs a new ShowNsxCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest); + + /** ShowNsxCredentialsRequest privateCloud. */ + public privateCloud: string; + + /** + * Creates a new ShowNsxCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ShowNsxCredentialsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest): google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest; + + /** + * Encodes the specified ShowNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * @param message ShowNsxCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShowNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * @param message ShowNsxCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShowNsxCredentialsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ShowNsxCredentialsRequest; + + /** + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShowNsxCredentialsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ShowNsxCredentialsRequest; + + /** + * Verifies a ShowNsxCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShowNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShowNsxCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest; + + /** + * Creates a plain object from a ShowNsxCredentialsRequest message. Also converts values to other types if specified. + * @param message ShowNsxCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShowNsxCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShowNsxCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ShowVcenterCredentialsRequest. */ + interface IShowVcenterCredentialsRequest { + + /** ShowVcenterCredentialsRequest privateCloud */ + privateCloud?: (string|null); + } + + /** Represents a ShowVcenterCredentialsRequest. */ + class ShowVcenterCredentialsRequest implements IShowVcenterCredentialsRequest { + + /** + * Constructs a new ShowVcenterCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest); + + /** ShowVcenterCredentialsRequest privateCloud. */ + public privateCloud: string; + + /** + * Creates a new ShowVcenterCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ShowVcenterCredentialsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest): google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest; + + /** + * Encodes the specified ShowVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * @param message ShowVcenterCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ShowVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * @param message ShowVcenterCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ShowVcenterCredentialsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ShowVcenterCredentialsRequest; + + /** + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ShowVcenterCredentialsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ShowVcenterCredentialsRequest; + + /** + * Verifies a ShowVcenterCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ShowVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ShowVcenterCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest; + + /** + * Creates a plain object from a ShowVcenterCredentialsRequest message. Also converts values to other types if specified. + * @param message ShowVcenterCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ShowVcenterCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ShowVcenterCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResetNsxCredentialsRequest. */ + interface IResetNsxCredentialsRequest { + + /** ResetNsxCredentialsRequest privateCloud */ + privateCloud?: (string|null); + + /** ResetNsxCredentialsRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ResetNsxCredentialsRequest. */ + class ResetNsxCredentialsRequest implements IResetNsxCredentialsRequest { + + /** + * Constructs a new ResetNsxCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest); + + /** ResetNsxCredentialsRequest privateCloud. */ + public privateCloud: string; + + /** ResetNsxCredentialsRequest requestId. */ + public requestId: string; + + /** + * Creates a new ResetNsxCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResetNsxCredentialsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest): google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest; + + /** + * Encodes the specified ResetNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * @param message ResetNsxCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResetNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * @param message ResetNsxCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResetNsxCredentialsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ResetNsxCredentialsRequest; + + /** + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResetNsxCredentialsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ResetNsxCredentialsRequest; + + /** + * Verifies a ResetNsxCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResetNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResetNsxCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest; + + /** + * Creates a plain object from a ResetNsxCredentialsRequest message. Also converts values to other types if specified. + * @param message ResetNsxCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResetNsxCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResetNsxCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResetVcenterCredentialsRequest. */ + interface IResetVcenterCredentialsRequest { + + /** ResetVcenterCredentialsRequest privateCloud */ + privateCloud?: (string|null); + + /** ResetVcenterCredentialsRequest requestId */ + requestId?: (string|null); + } + + /** Represents a ResetVcenterCredentialsRequest. */ + class ResetVcenterCredentialsRequest implements IResetVcenterCredentialsRequest { + + /** + * Constructs a new ResetVcenterCredentialsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest); + + /** ResetVcenterCredentialsRequest privateCloud. */ + public privateCloud: string; + + /** ResetVcenterCredentialsRequest requestId. */ + public requestId: string; + + /** + * Creates a new ResetVcenterCredentialsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ResetVcenterCredentialsRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest): google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest; + + /** + * Encodes the specified ResetVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * @param message ResetVcenterCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResetVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * @param message ResetVcenterCredentialsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResetVcenterCredentialsRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ResetVcenterCredentialsRequest; + + /** + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResetVcenterCredentialsRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ResetVcenterCredentialsRequest; + + /** + * Verifies a ResetVcenterCredentialsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResetVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResetVcenterCredentialsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest; + + /** + * Creates a plain object from a ResetVcenterCredentialsRequest message. Also converts values to other types if specified. + * @param message ResetVcenterCredentialsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResetVcenterCredentialsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResetVcenterCredentialsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListHcxActivationKeysResponse. */ + interface IListHcxActivationKeysResponse { + + /** ListHcxActivationKeysResponse hcxActivationKeys */ + hcxActivationKeys?: (google.cloud.vmwareengine.v1.IHcxActivationKey[]|null); + + /** ListHcxActivationKeysResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListHcxActivationKeysResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListHcxActivationKeysResponse. */ + class ListHcxActivationKeysResponse implements IListHcxActivationKeysResponse { + + /** + * Constructs a new ListHcxActivationKeysResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse); + + /** ListHcxActivationKeysResponse hcxActivationKeys. */ + public hcxActivationKeys: google.cloud.vmwareengine.v1.IHcxActivationKey[]; + + /** ListHcxActivationKeysResponse nextPageToken. */ + public nextPageToken: string; + + /** ListHcxActivationKeysResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListHcxActivationKeysResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHcxActivationKeysResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse): google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse; + + /** + * Encodes the specified ListHcxActivationKeysResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * @param message ListHcxActivationKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHcxActivationKeysResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * @param message ListHcxActivationKeysResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHcxActivationKeysResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListHcxActivationKeysResponse; + + /** + * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHcxActivationKeysResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListHcxActivationKeysResponse; + + /** + * Verifies a ListHcxActivationKeysResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHcxActivationKeysResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHcxActivationKeysResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse; + + /** + * Creates a plain object from a ListHcxActivationKeysResponse message. Also converts values to other types if specified. + * @param message ListHcxActivationKeysResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHcxActivationKeysResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHcxActivationKeysResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HcxActivationKey. */ + interface IHcxActivationKey { + + /** HcxActivationKey name */ + name?: (string|null); + + /** HcxActivationKey createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** HcxActivationKey state */ + state?: (google.cloud.vmwareengine.v1.HcxActivationKey.State|keyof typeof google.cloud.vmwareengine.v1.HcxActivationKey.State|null); + + /** HcxActivationKey activationKey */ + activationKey?: (string|null); + + /** HcxActivationKey uid */ + uid?: (string|null); + } + + /** Represents a HcxActivationKey. */ + class HcxActivationKey implements IHcxActivationKey { + + /** + * Constructs a new HcxActivationKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IHcxActivationKey); + + /** HcxActivationKey name. */ + public name: string; + + /** HcxActivationKey createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** HcxActivationKey state. */ + public state: (google.cloud.vmwareengine.v1.HcxActivationKey.State|keyof typeof google.cloud.vmwareengine.v1.HcxActivationKey.State); + + /** HcxActivationKey activationKey. */ + public activationKey: string; + + /** HcxActivationKey uid. */ + public uid: string; + + /** + * Creates a new HcxActivationKey instance using the specified properties. + * @param [properties] Properties to set + * @returns HcxActivationKey instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IHcxActivationKey): google.cloud.vmwareengine.v1.HcxActivationKey; + + /** + * Encodes the specified HcxActivationKey message. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * @param message HcxActivationKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IHcxActivationKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HcxActivationKey message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * @param message HcxActivationKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IHcxActivationKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HcxActivationKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HcxActivationKey + * @throws {Error} If the payload is not 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.vmwareengine.v1.HcxActivationKey; + + /** + * Decodes a HcxActivationKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HcxActivationKey + * @throws {Error} If the payload 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.vmwareengine.v1.HcxActivationKey; + + /** + * Verifies a HcxActivationKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HcxActivationKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HcxActivationKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.HcxActivationKey; + + /** + * Creates a plain object from a HcxActivationKey message. Also converts values to other types if specified. + * @param message HcxActivationKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.HcxActivationKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HcxActivationKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HcxActivationKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace HcxActivationKey { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + AVAILABLE = 1, + CONSUMED = 2, + CREATING = 3 + } + } + + /** Properties of a ListHcxActivationKeysRequest. */ + interface IListHcxActivationKeysRequest { + + /** ListHcxActivationKeysRequest parent */ + parent?: (string|null); + + /** ListHcxActivationKeysRequest pageSize */ + pageSize?: (number|null); + + /** ListHcxActivationKeysRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListHcxActivationKeysRequest. */ + class ListHcxActivationKeysRequest implements IListHcxActivationKeysRequest { + + /** + * Constructs a new ListHcxActivationKeysRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest); + + /** ListHcxActivationKeysRequest parent. */ + public parent: string; + + /** ListHcxActivationKeysRequest pageSize. */ + public pageSize: number; + + /** ListHcxActivationKeysRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListHcxActivationKeysRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListHcxActivationKeysRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest): google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest; + + /** + * Encodes the specified ListHcxActivationKeysRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * @param message ListHcxActivationKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListHcxActivationKeysRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * @param message ListHcxActivationKeysRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListHcxActivationKeysRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListHcxActivationKeysRequest; + + /** + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListHcxActivationKeysRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListHcxActivationKeysRequest; + + /** + * Verifies a ListHcxActivationKeysRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListHcxActivationKeysRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListHcxActivationKeysRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest; + + /** + * Creates a plain object from a ListHcxActivationKeysRequest message. Also converts values to other types if specified. + * @param message ListHcxActivationKeysRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListHcxActivationKeysRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListHcxActivationKeysRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetHcxActivationKeyRequest. */ + interface IGetHcxActivationKeyRequest { + + /** GetHcxActivationKeyRequest name */ + name?: (string|null); + } + + /** Represents a GetHcxActivationKeyRequest. */ + class GetHcxActivationKeyRequest implements IGetHcxActivationKeyRequest { + + /** + * Constructs a new GetHcxActivationKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest); + + /** GetHcxActivationKeyRequest name. */ + public name: string; + + /** + * Creates a new GetHcxActivationKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetHcxActivationKeyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest): google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest; + + /** + * Encodes the specified GetHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * @param message GetHcxActivationKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * @param message GetHcxActivationKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetHcxActivationKeyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetHcxActivationKeyRequest; + + /** + * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetHcxActivationKeyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetHcxActivationKeyRequest; + + /** + * Verifies a GetHcxActivationKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetHcxActivationKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest; + + /** + * Creates a plain object from a GetHcxActivationKeyRequest message. Also converts values to other types if specified. + * @param message GetHcxActivationKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetHcxActivationKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetHcxActivationKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateHcxActivationKeyRequest. */ + interface ICreateHcxActivationKeyRequest { + + /** CreateHcxActivationKeyRequest parent */ + parent?: (string|null); + + /** CreateHcxActivationKeyRequest hcxActivationKey */ + hcxActivationKey?: (google.cloud.vmwareengine.v1.IHcxActivationKey|null); + + /** CreateHcxActivationKeyRequest hcxActivationKeyId */ + hcxActivationKeyId?: (string|null); + + /** CreateHcxActivationKeyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateHcxActivationKeyRequest. */ + class CreateHcxActivationKeyRequest implements ICreateHcxActivationKeyRequest { + + /** + * Constructs a new CreateHcxActivationKeyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest); + + /** CreateHcxActivationKeyRequest parent. */ + public parent: string; + + /** CreateHcxActivationKeyRequest hcxActivationKey. */ + public hcxActivationKey?: (google.cloud.vmwareengine.v1.IHcxActivationKey|null); + + /** CreateHcxActivationKeyRequest hcxActivationKeyId. */ + public hcxActivationKeyId: string; + + /** CreateHcxActivationKeyRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateHcxActivationKeyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateHcxActivationKeyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest): google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest; + + /** + * Encodes the specified CreateHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * @param message CreateHcxActivationKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * @param message CreateHcxActivationKeyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateHcxActivationKeyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.CreateHcxActivationKeyRequest; + + /** + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateHcxActivationKeyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.CreateHcxActivationKeyRequest; + + /** + * Verifies a CreateHcxActivationKeyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateHcxActivationKeyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest; + + /** + * Creates a plain object from a CreateHcxActivationKeyRequest message. Also converts values to other types if specified. + * @param message CreateHcxActivationKeyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateHcxActivationKeyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateHcxActivationKeyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Hcx. */ + interface IHcx { + + /** Hcx internalIp */ + internalIp?: (string|null); + + /** Hcx version */ + version?: (string|null); + + /** Hcx state */ + state?: (google.cloud.vmwareengine.v1.Hcx.State|keyof typeof google.cloud.vmwareengine.v1.Hcx.State|null); + + /** Hcx fqdn */ + fqdn?: (string|null); + } + + /** Represents a Hcx. */ + class Hcx implements IHcx { + + /** + * Constructs a new Hcx. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IHcx); + + /** Hcx internalIp. */ + public internalIp: string; + + /** Hcx version. */ + public version: string; + + /** Hcx state. */ + public state: (google.cloud.vmwareengine.v1.Hcx.State|keyof typeof google.cloud.vmwareengine.v1.Hcx.State); + + /** Hcx fqdn. */ + public fqdn: string; + + /** + * Creates a new Hcx instance using the specified properties. + * @param [properties] Properties to set + * @returns Hcx instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IHcx): google.cloud.vmwareengine.v1.Hcx; + + /** + * Encodes the specified Hcx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * @param message Hcx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IHcx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Hcx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * @param message Hcx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IHcx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Hcx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Hcx + * @throws {Error} If the payload is not 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.vmwareengine.v1.Hcx; + + /** + * Decodes a Hcx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Hcx + * @throws {Error} If the payload 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.vmwareengine.v1.Hcx; + + /** + * Verifies a Hcx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Hcx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Hcx + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Hcx; + + /** + * Creates a plain object from a Hcx message. Also converts values to other types if specified. + * @param message Hcx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Hcx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Hcx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Hcx + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Hcx { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2 + } + } + + /** Properties of a Nsx. */ + interface INsx { + + /** Nsx internalIp */ + internalIp?: (string|null); + + /** Nsx version */ + version?: (string|null); + + /** Nsx state */ + state?: (google.cloud.vmwareengine.v1.Nsx.State|keyof typeof google.cloud.vmwareengine.v1.Nsx.State|null); + + /** Nsx fqdn */ + fqdn?: (string|null); + } + + /** Represents a Nsx. */ + class Nsx implements INsx { + + /** + * Constructs a new Nsx. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INsx); + + /** Nsx internalIp. */ + public internalIp: string; + + /** Nsx version. */ + public version: string; + + /** Nsx state. */ + public state: (google.cloud.vmwareengine.v1.Nsx.State|keyof typeof google.cloud.vmwareengine.v1.Nsx.State); + + /** Nsx fqdn. */ + public fqdn: string; + + /** + * Creates a new Nsx instance using the specified properties. + * @param [properties] Properties to set + * @returns Nsx instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.INsx): google.cloud.vmwareengine.v1.Nsx; + + /** + * Encodes the specified Nsx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * @param message Nsx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.INsx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Nsx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * @param message Nsx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.INsx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Nsx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Nsx + * @throws {Error} If the payload is not 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.vmwareengine.v1.Nsx; + + /** + * Decodes a Nsx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Nsx + * @throws {Error} If the payload 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.vmwareengine.v1.Nsx; + + /** + * Verifies a Nsx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Nsx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Nsx + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Nsx; + + /** + * Creates a plain object from a Nsx message. Also converts values to other types if specified. + * @param message Nsx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Nsx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Nsx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Nsx + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Nsx { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2 + } + } + + /** Properties of a Vcenter. */ + interface IVcenter { + + /** Vcenter internalIp */ + internalIp?: (string|null); + + /** Vcenter version */ + version?: (string|null); + + /** Vcenter state */ + state?: (google.cloud.vmwareengine.v1.Vcenter.State|keyof typeof google.cloud.vmwareengine.v1.Vcenter.State|null); + + /** Vcenter fqdn */ + fqdn?: (string|null); + } + + /** Represents a Vcenter. */ + class Vcenter implements IVcenter { + + /** + * Constructs a new Vcenter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IVcenter); + + /** Vcenter internalIp. */ + public internalIp: string; + + /** Vcenter version. */ + public version: string; + + /** Vcenter state. */ + public state: (google.cloud.vmwareengine.v1.Vcenter.State|keyof typeof google.cloud.vmwareengine.v1.Vcenter.State); + + /** Vcenter fqdn. */ + public fqdn: string; + + /** + * Creates a new Vcenter instance using the specified properties. + * @param [properties] Properties to set + * @returns Vcenter instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IVcenter): google.cloud.vmwareengine.v1.Vcenter; + + /** + * Encodes the specified Vcenter message. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. + * @param message Vcenter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IVcenter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Vcenter message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. + * @param message Vcenter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IVcenter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Vcenter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Vcenter + * @throws {Error} If the payload is not 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.vmwareengine.v1.Vcenter; + + /** + * Decodes a Vcenter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Vcenter + * @throws {Error} If the payload 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.vmwareengine.v1.Vcenter; + + /** + * Verifies a Vcenter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Vcenter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Vcenter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.Vcenter; + + /** + * Creates a plain object from a Vcenter message. Also converts values to other types if specified. + * @param message Vcenter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.Vcenter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Vcenter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Vcenter + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Vcenter { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + CREATING = 2 + } + } + + /** Properties of a NetworkPolicy. */ + interface INetworkPolicy { + + /** NetworkPolicy name */ + name?: (string|null); + + /** NetworkPolicy createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** NetworkPolicy updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** NetworkPolicy internetAccess */ + internetAccess?: (google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null); + + /** NetworkPolicy externalIp */ + externalIp?: (google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null); + + /** NetworkPolicy edgeServicesCidr */ + edgeServicesCidr?: (string|null); + + /** NetworkPolicy uid */ + uid?: (string|null); + + /** NetworkPolicy vmwareEngineNetwork */ + vmwareEngineNetwork?: (string|null); + + /** NetworkPolicy description */ + description?: (string|null); + + /** NetworkPolicy vmwareEngineNetworkCanonical */ + vmwareEngineNetworkCanonical?: (string|null); + } + + /** Represents a NetworkPolicy. */ + class NetworkPolicy implements INetworkPolicy { + + /** + * Constructs a new NetworkPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.INetworkPolicy); + + /** NetworkPolicy name. */ + public name: string; + + /** NetworkPolicy createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** NetworkPolicy updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** NetworkPolicy internetAccess. */ + public internetAccess?: (google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null); + + /** NetworkPolicy externalIp. */ + public externalIp?: (google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null); + + /** NetworkPolicy edgeServicesCidr. */ + public edgeServicesCidr: string; + + /** NetworkPolicy uid. */ + public uid: string; + + /** NetworkPolicy vmwareEngineNetwork. */ + public vmwareEngineNetwork: string; + + /** NetworkPolicy description. */ + public description: string; + + /** NetworkPolicy vmwareEngineNetworkCanonical. */ + public vmwareEngineNetworkCanonical: string; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPolicy instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.INetworkPolicy): google.cloud.vmwareengine.v1.NetworkPolicy; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * @param message NetworkPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.INetworkPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPolicy + * @throws {Error} If the payload is not 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.vmwareengine.v1.NetworkPolicy; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPolicy + * @throws {Error} If the payload 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.vmwareengine.v1.NetworkPolicy; + + /** + * Verifies a NetworkPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.NetworkPolicy; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @param message NetworkPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.NetworkPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkPolicy { + + /** Properties of a NetworkService. */ + interface INetworkService { + + /** NetworkService enabled */ + enabled?: (boolean|null); + + /** NetworkService state */ + state?: (google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|keyof typeof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|null); + } + + /** Represents a NetworkService. */ + class NetworkService implements INetworkService { + + /** + * Constructs a new NetworkService. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService); + + /** NetworkService enabled. */ + public enabled: boolean; + + /** NetworkService state. */ + public state: (google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|keyof typeof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State); + + /** + * Creates a new NetworkService instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkService instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService): google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService; + + /** + * Encodes the specified NetworkService message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @param message NetworkService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkService message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @param message NetworkService message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkService message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkService + * @throws {Error} If the payload is not 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.vmwareengine.v1.NetworkPolicy.NetworkService; + + /** + * Decodes a NetworkService message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkService + * @throws {Error} If the payload 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.vmwareengine.v1.NetworkPolicy.NetworkService; + + /** + * Verifies a NetworkService message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkService message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkService + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService; + + /** + * Creates a plain object from a NetworkService message. Also converts values to other types if specified. + * @param message NetworkService + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkService to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkService + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkService { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + UNPROVISIONED = 1, + RECONCILING = 2, + ACTIVE = 3 + } + } + } + + /** Properties of a ListNetworkPoliciesRequest. */ + interface IListNetworkPoliciesRequest { + + /** ListNetworkPoliciesRequest parent */ + parent?: (string|null); + + /** ListNetworkPoliciesRequest pageSize */ + pageSize?: (number|null); + + /** ListNetworkPoliciesRequest pageToken */ + pageToken?: (string|null); + + /** ListNetworkPoliciesRequest filter */ + filter?: (string|null); + + /** ListNetworkPoliciesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListNetworkPoliciesRequest. */ + class ListNetworkPoliciesRequest implements IListNetworkPoliciesRequest { + + /** + * Constructs a new ListNetworkPoliciesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest); + + /** ListNetworkPoliciesRequest parent. */ + public parent: string; + + /** ListNetworkPoliciesRequest pageSize. */ + public pageSize: number; + + /** ListNetworkPoliciesRequest pageToken. */ + public pageToken: string; + + /** ListNetworkPoliciesRequest filter. */ + public filter: string; + + /** ListNetworkPoliciesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListNetworkPoliciesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworkPoliciesRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest): google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest; + + /** + * Encodes the specified ListNetworkPoliciesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * @param message ListNetworkPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworkPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * @param message ListNetworkPoliciesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworkPoliciesRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListNetworkPoliciesRequest; + + /** + * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworkPoliciesRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListNetworkPoliciesRequest; + + /** + * Verifies a ListNetworkPoliciesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworkPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworkPoliciesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest; + + /** + * Creates a plain object from a ListNetworkPoliciesRequest message. Also converts values to other types if specified. + * @param message ListNetworkPoliciesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworkPoliciesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNetworkPoliciesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListNetworkPoliciesResponse. */ + interface IListNetworkPoliciesResponse { + + /** ListNetworkPoliciesResponse networkPolicies */ + networkPolicies?: (google.cloud.vmwareengine.v1.INetworkPolicy[]|null); + + /** ListNetworkPoliciesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListNetworkPoliciesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListNetworkPoliciesResponse. */ + class ListNetworkPoliciesResponse implements IListNetworkPoliciesResponse { + + /** + * Constructs a new ListNetworkPoliciesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse); + + /** ListNetworkPoliciesResponse networkPolicies. */ + public networkPolicies: google.cloud.vmwareengine.v1.INetworkPolicy[]; + + /** ListNetworkPoliciesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListNetworkPoliciesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListNetworkPoliciesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNetworkPoliciesResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse): google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse; + + /** + * Encodes the specified ListNetworkPoliciesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * @param message ListNetworkPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNetworkPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * @param message ListNetworkPoliciesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNetworkPoliciesResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListNetworkPoliciesResponse; + + /** + * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNetworkPoliciesResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListNetworkPoliciesResponse; + + /** + * Verifies a ListNetworkPoliciesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNetworkPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNetworkPoliciesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse; + + /** + * Creates a plain object from a ListNetworkPoliciesResponse message. Also converts values to other types if specified. + * @param message ListNetworkPoliciesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNetworkPoliciesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNetworkPoliciesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetNetworkPolicyRequest. */ + interface IGetNetworkPolicyRequest { + + /** GetNetworkPolicyRequest name */ + name?: (string|null); + } + + /** Represents a GetNetworkPolicyRequest. */ + class GetNetworkPolicyRequest implements IGetNetworkPolicyRequest { + + /** + * Constructs a new GetNetworkPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest); + + /** GetNetworkPolicyRequest name. */ + public name: string; + + /** + * Creates a new GetNetworkPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetNetworkPolicyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest): google.cloud.vmwareengine.v1.GetNetworkPolicyRequest; + + /** + * Encodes the specified GetNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * @param message GetNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * @param message GetNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetNetworkPolicyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetNetworkPolicyRequest; + + /** + * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetNetworkPolicyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetNetworkPolicyRequest; + + /** + * Verifies a GetNetworkPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetNetworkPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetNetworkPolicyRequest; + + /** + * Creates a plain object from a GetNetworkPolicyRequest message. Also converts values to other types if specified. + * @param message GetNetworkPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetNetworkPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetNetworkPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetNetworkPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateNetworkPolicyRequest. */ + interface IUpdateNetworkPolicyRequest { + + /** UpdateNetworkPolicyRequest networkPolicy */ + networkPolicy?: (google.cloud.vmwareengine.v1.INetworkPolicy|null); + + /** UpdateNetworkPolicyRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateNetworkPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateNetworkPolicyRequest. */ + class UpdateNetworkPolicyRequest implements IUpdateNetworkPolicyRequest { + + /** + * Constructs a new UpdateNetworkPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest); + + /** UpdateNetworkPolicyRequest networkPolicy. */ + public networkPolicy?: (google.cloud.vmwareengine.v1.INetworkPolicy|null); + + /** UpdateNetworkPolicyRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateNetworkPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateNetworkPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateNetworkPolicyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest): google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest; + + /** + * Encodes the specified UpdateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * @param message UpdateNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * @param message UpdateNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateNetworkPolicyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.UpdateNetworkPolicyRequest; + + /** + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateNetworkPolicyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.UpdateNetworkPolicyRequest; + + /** + * Verifies an UpdateNetworkPolicyRequest message. + * @param message Plain 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 UpdateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateNetworkPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest; + + /** + * Creates a plain object from an UpdateNetworkPolicyRequest message. Also converts values to other types if specified. + * @param message UpdateNetworkPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateNetworkPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateNetworkPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateNetworkPolicyRequest. */ + interface ICreateNetworkPolicyRequest { + + /** CreateNetworkPolicyRequest parent */ + parent?: (string|null); + + /** CreateNetworkPolicyRequest networkPolicyId */ + networkPolicyId?: (string|null); + + /** CreateNetworkPolicyRequest networkPolicy */ + networkPolicy?: (google.cloud.vmwareengine.v1.INetworkPolicy|null); + + /** CreateNetworkPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateNetworkPolicyRequest. */ + class CreateNetworkPolicyRequest implements ICreateNetworkPolicyRequest { + + /** + * Constructs a new CreateNetworkPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest); + + /** CreateNetworkPolicyRequest parent. */ + public parent: string; + + /** CreateNetworkPolicyRequest networkPolicyId. */ + public networkPolicyId: string; + + /** CreateNetworkPolicyRequest networkPolicy. */ + public networkPolicy?: (google.cloud.vmwareengine.v1.INetworkPolicy|null); + + /** CreateNetworkPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateNetworkPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateNetworkPolicyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest): google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest; + + /** + * Encodes the specified CreateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * @param message CreateNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * @param message CreateNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateNetworkPolicyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.CreateNetworkPolicyRequest; + + /** + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateNetworkPolicyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.CreateNetworkPolicyRequest; + + /** + * Verifies a CreateNetworkPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateNetworkPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest; + + /** + * Creates a plain object from a CreateNetworkPolicyRequest message. Also converts values to other types if specified. + * @param message CreateNetworkPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateNetworkPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateNetworkPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteNetworkPolicyRequest. */ + interface IDeleteNetworkPolicyRequest { + + /** DeleteNetworkPolicyRequest name */ + name?: (string|null); + + /** DeleteNetworkPolicyRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteNetworkPolicyRequest. */ + class DeleteNetworkPolicyRequest implements IDeleteNetworkPolicyRequest { + + /** + * Constructs a new DeleteNetworkPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest); + + /** DeleteNetworkPolicyRequest name. */ + public name: string; + + /** DeleteNetworkPolicyRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteNetworkPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteNetworkPolicyRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest): google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest; + + /** + * Encodes the specified DeleteNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * @param message DeleteNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * @param message DeleteNetworkPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteNetworkPolicyRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.DeleteNetworkPolicyRequest; + + /** + * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteNetworkPolicyRequest + * @throws {Error} If the payload 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.vmwareengine.v1.DeleteNetworkPolicyRequest; + + /** + * Verifies a DeleteNetworkPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteNetworkPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest; + + /** + * Creates a plain object from a DeleteNetworkPolicyRequest message. Also converts values to other types if specified. + * @param message DeleteNetworkPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteNetworkPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteNetworkPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a VmwareEngineNetwork. */ + interface IVmwareEngineNetwork { + + /** VmwareEngineNetwork name */ + name?: (string|null); + + /** VmwareEngineNetwork createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** VmwareEngineNetwork updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** VmwareEngineNetwork description */ + description?: (string|null); + + /** VmwareEngineNetwork vpcNetworks */ + vpcNetworks?: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork[]|null); + + /** VmwareEngineNetwork state */ + state?: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|null); + + /** VmwareEngineNetwork type */ + type?: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|null); + + /** VmwareEngineNetwork uid */ + uid?: (string|null); + + /** VmwareEngineNetwork etag */ + etag?: (string|null); + } + + /** Represents a VmwareEngineNetwork. */ + class VmwareEngineNetwork implements IVmwareEngineNetwork { + + /** + * Constructs a new VmwareEngineNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IVmwareEngineNetwork); + + /** VmwareEngineNetwork name. */ + public name: string; + + /** VmwareEngineNetwork createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** VmwareEngineNetwork updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** VmwareEngineNetwork description. */ + public description: string; + + /** VmwareEngineNetwork vpcNetworks. */ + public vpcNetworks: google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork[]; + + /** VmwareEngineNetwork state. */ + public state: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.State); + + /** VmwareEngineNetwork type. */ + public type: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type); + + /** VmwareEngineNetwork uid. */ + public uid: string; + + /** VmwareEngineNetwork etag. */ + public etag: string; + + /** + * Creates a new VmwareEngineNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns VmwareEngineNetwork instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IVmwareEngineNetwork): google.cloud.vmwareengine.v1.VmwareEngineNetwork; + + /** + * Encodes the specified VmwareEngineNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * @param message VmwareEngineNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IVmwareEngineNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VmwareEngineNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * @param message VmwareEngineNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IVmwareEngineNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VmwareEngineNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VmwareEngineNetwork + * @throws {Error} If the payload is not 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.vmwareengine.v1.VmwareEngineNetwork; + + /** + * Decodes a VmwareEngineNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VmwareEngineNetwork + * @throws {Error} If the payload 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.vmwareengine.v1.VmwareEngineNetwork; + + /** + * Verifies a VmwareEngineNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VmwareEngineNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VmwareEngineNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.VmwareEngineNetwork; + + /** + * Creates a plain object from a VmwareEngineNetwork message. Also converts values to other types if specified. + * @param message VmwareEngineNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.VmwareEngineNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VmwareEngineNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VmwareEngineNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VmwareEngineNetwork { + + /** Properties of a VpcNetwork. */ + interface IVpcNetwork { + + /** VpcNetwork type */ + type?: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|null); + + /** VpcNetwork network */ + network?: (string|null); + } + + /** Represents a VpcNetwork. */ + class VpcNetwork implements IVpcNetwork { + + /** + * Constructs a new VpcNetwork. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork); + + /** VpcNetwork type. */ + public type: (google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|keyof typeof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type); + + /** VpcNetwork network. */ + public network: string; + + /** + * Creates a new VpcNetwork instance using the specified properties. + * @param [properties] Properties to set + * @returns VpcNetwork instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork): google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork; + + /** + * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. + * @param message VpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. + * @param message VpcNetwork message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VpcNetwork + * @throws {Error} If the payload is not 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.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VpcNetwork + * @throws {Error} If the payload 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.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork; + + /** + * Verifies a VpcNetwork message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VpcNetwork + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork; + + /** + * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. + * @param message VpcNetwork + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VpcNetwork to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for VpcNetwork + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace VpcNetwork { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + INTRANET = 1, + INTERNET = 2, + GOOGLE_CLOUD = 3 + } + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + UPDATING = 3, + DELETING = 4 + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + LEGACY = 1 + } + } + + /** Properties of a CreateVmwareEngineNetworkRequest. */ + interface ICreateVmwareEngineNetworkRequest { + + /** CreateVmwareEngineNetworkRequest parent */ + parent?: (string|null); + + /** CreateVmwareEngineNetworkRequest vmwareEngineNetworkId */ + vmwareEngineNetworkId?: (string|null); + + /** CreateVmwareEngineNetworkRequest vmwareEngineNetwork */ + vmwareEngineNetwork?: (google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null); + + /** CreateVmwareEngineNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateVmwareEngineNetworkRequest. */ + class CreateVmwareEngineNetworkRequest implements ICreateVmwareEngineNetworkRequest { + + /** + * Constructs a new CreateVmwareEngineNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest); + + /** CreateVmwareEngineNetworkRequest parent. */ + public parent: string; + + /** CreateVmwareEngineNetworkRequest vmwareEngineNetworkId. */ + public vmwareEngineNetworkId: string; + + /** CreateVmwareEngineNetworkRequest vmwareEngineNetwork. */ + public vmwareEngineNetwork?: (google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null); + + /** CreateVmwareEngineNetworkRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateVmwareEngineNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateVmwareEngineNetworkRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest): google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest; + + /** + * Encodes the specified CreateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * @param message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * @param message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.CreateVmwareEngineNetworkRequest; + + /** + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateVmwareEngineNetworkRequest + * @throws {Error} If the payload 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.vmwareengine.v1.CreateVmwareEngineNetworkRequest; + + /** + * Verifies a CreateVmwareEngineNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateVmwareEngineNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest; + + /** + * Creates a plain object from a CreateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @param message CreateVmwareEngineNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateVmwareEngineNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateVmwareEngineNetworkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateVmwareEngineNetworkRequest. */ + interface IUpdateVmwareEngineNetworkRequest { + + /** UpdateVmwareEngineNetworkRequest vmwareEngineNetwork */ + vmwareEngineNetwork?: (google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null); + + /** UpdateVmwareEngineNetworkRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateVmwareEngineNetworkRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateVmwareEngineNetworkRequest. */ + class UpdateVmwareEngineNetworkRequest implements IUpdateVmwareEngineNetworkRequest { + + /** + * Constructs a new UpdateVmwareEngineNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest); + + /** UpdateVmwareEngineNetworkRequest vmwareEngineNetwork. */ + public vmwareEngineNetwork?: (google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null); + + /** UpdateVmwareEngineNetworkRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateVmwareEngineNetworkRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateVmwareEngineNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateVmwareEngineNetworkRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest): google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest; + + /** + * Encodes the specified UpdateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * @param message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * @param message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.UpdateVmwareEngineNetworkRequest; + + /** + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateVmwareEngineNetworkRequest + * @throws {Error} If the payload 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.vmwareengine.v1.UpdateVmwareEngineNetworkRequest; + + /** + * Verifies an UpdateVmwareEngineNetworkRequest message. + * @param message Plain 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 UpdateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateVmwareEngineNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest; + + /** + * Creates a plain object from an UpdateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @param message UpdateVmwareEngineNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateVmwareEngineNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateVmwareEngineNetworkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteVmwareEngineNetworkRequest. */ + interface IDeleteVmwareEngineNetworkRequest { + + /** DeleteVmwareEngineNetworkRequest name */ + name?: (string|null); + + /** DeleteVmwareEngineNetworkRequest requestId */ + requestId?: (string|null); + + /** DeleteVmwareEngineNetworkRequest etag */ + etag?: (string|null); + } + + /** Represents a DeleteVmwareEngineNetworkRequest. */ + class DeleteVmwareEngineNetworkRequest implements IDeleteVmwareEngineNetworkRequest { + + /** + * Constructs a new DeleteVmwareEngineNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest); + + /** DeleteVmwareEngineNetworkRequest name. */ + public name: string; + + /** DeleteVmwareEngineNetworkRequest requestId. */ + public requestId: string; + + /** DeleteVmwareEngineNetworkRequest etag. */ + public etag: string; + + /** + * Creates a new DeleteVmwareEngineNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteVmwareEngineNetworkRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest): google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest; + + /** + * Encodes the specified DeleteVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * @param message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * @param message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteVmwareEngineNetworkRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.DeleteVmwareEngineNetworkRequest; + + /** + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteVmwareEngineNetworkRequest + * @throws {Error} If the payload 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.vmwareengine.v1.DeleteVmwareEngineNetworkRequest; + + /** + * Verifies a DeleteVmwareEngineNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteVmwareEngineNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest; + + /** + * Creates a plain object from a DeleteVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @param message DeleteVmwareEngineNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteVmwareEngineNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteVmwareEngineNetworkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetVmwareEngineNetworkRequest. */ + interface IGetVmwareEngineNetworkRequest { + + /** GetVmwareEngineNetworkRequest name */ + name?: (string|null); + } + + /** Represents a GetVmwareEngineNetworkRequest. */ + class GetVmwareEngineNetworkRequest implements IGetVmwareEngineNetworkRequest { + + /** + * Constructs a new GetVmwareEngineNetworkRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest); + + /** GetVmwareEngineNetworkRequest name. */ + public name: string; + + /** + * Creates a new GetVmwareEngineNetworkRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetVmwareEngineNetworkRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest): google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest; + + /** + * Encodes the specified GetVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * @param message GetVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * @param message GetVmwareEngineNetworkRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetVmwareEngineNetworkRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.GetVmwareEngineNetworkRequest; + + /** + * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetVmwareEngineNetworkRequest + * @throws {Error} If the payload 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.vmwareengine.v1.GetVmwareEngineNetworkRequest; + + /** + * Verifies a GetVmwareEngineNetworkRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetVmwareEngineNetworkRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest; + + /** + * Creates a plain object from a GetVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @param message GetVmwareEngineNetworkRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetVmwareEngineNetworkRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetVmwareEngineNetworkRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVmwareEngineNetworksRequest. */ + interface IListVmwareEngineNetworksRequest { + + /** ListVmwareEngineNetworksRequest parent */ + parent?: (string|null); + + /** ListVmwareEngineNetworksRequest pageSize */ + pageSize?: (number|null); + + /** ListVmwareEngineNetworksRequest pageToken */ + pageToken?: (string|null); + + /** ListVmwareEngineNetworksRequest filter */ + filter?: (string|null); + + /** ListVmwareEngineNetworksRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListVmwareEngineNetworksRequest. */ + class ListVmwareEngineNetworksRequest implements IListVmwareEngineNetworksRequest { + + /** + * Constructs a new ListVmwareEngineNetworksRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest); + + /** ListVmwareEngineNetworksRequest parent. */ + public parent: string; + + /** ListVmwareEngineNetworksRequest pageSize. */ + public pageSize: number; + + /** ListVmwareEngineNetworksRequest pageToken. */ + public pageToken: string; + + /** ListVmwareEngineNetworksRequest filter. */ + public filter: string; + + /** ListVmwareEngineNetworksRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListVmwareEngineNetworksRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVmwareEngineNetworksRequest instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest): google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest; + + /** + * Encodes the specified ListVmwareEngineNetworksRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * @param message ListVmwareEngineNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVmwareEngineNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * @param message ListVmwareEngineNetworksRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVmwareEngineNetworksRequest + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListVmwareEngineNetworksRequest; + + /** + * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVmwareEngineNetworksRequest + * @throws {Error} If the payload 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.vmwareengine.v1.ListVmwareEngineNetworksRequest; + + /** + * Verifies a ListVmwareEngineNetworksRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVmwareEngineNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVmwareEngineNetworksRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest; + + /** + * Creates a plain object from a ListVmwareEngineNetworksRequest message. Also converts values to other types if specified. + * @param message ListVmwareEngineNetworksRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVmwareEngineNetworksRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVmwareEngineNetworksRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListVmwareEngineNetworksResponse. */ + interface IListVmwareEngineNetworksResponse { + + /** ListVmwareEngineNetworksResponse vmwareEngineNetworks */ + vmwareEngineNetworks?: (google.cloud.vmwareengine.v1.IVmwareEngineNetwork[]|null); + + /** ListVmwareEngineNetworksResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListVmwareEngineNetworksResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListVmwareEngineNetworksResponse. */ + class ListVmwareEngineNetworksResponse implements IListVmwareEngineNetworksResponse { + + /** + * Constructs a new ListVmwareEngineNetworksResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse); + + /** ListVmwareEngineNetworksResponse vmwareEngineNetworks. */ + public vmwareEngineNetworks: google.cloud.vmwareengine.v1.IVmwareEngineNetwork[]; + + /** ListVmwareEngineNetworksResponse nextPageToken. */ + public nextPageToken: string; + + /** ListVmwareEngineNetworksResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListVmwareEngineNetworksResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListVmwareEngineNetworksResponse instance + */ + public static create(properties?: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse): google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse; + + /** + * Encodes the specified ListVmwareEngineNetworksResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * @param message ListVmwareEngineNetworksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListVmwareEngineNetworksResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * @param message ListVmwareEngineNetworksResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListVmwareEngineNetworksResponse + * @throws {Error} If the payload is not 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.vmwareengine.v1.ListVmwareEngineNetworksResponse; + + /** + * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListVmwareEngineNetworksResponse + * @throws {Error} If the payload 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.vmwareengine.v1.ListVmwareEngineNetworksResponse; + + /** + * Verifies a ListVmwareEngineNetworksResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListVmwareEngineNetworksResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListVmwareEngineNetworksResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse; + + /** + * Creates a plain object from a ListVmwareEngineNetworksResponse message. Also converts values to other types if specified. + * @param message ListVmwareEngineNetworksResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListVmwareEngineNetworksResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListVmwareEngineNetworksResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + } + } + + /** 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; + } + } +} diff --git a/packages/google-cloud-vmwareengine/protos/protos.js b/packages/google-cloud-vmwareengine/protos/protos.js new file mode 100644 index 00000000000..b71ae65a1c2 --- /dev/null +++ b/packages/google-cloud-vmwareengine/protos/protos.js @@ -0,0 +1,31415 @@ +// 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_vmwareengine_protos || ($protobuf.roots._google_cloud_vmwareengine_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.vmwareengine = (function() { + + /** + * Namespace vmwareengine. + * @memberof google.cloud + * @namespace + */ + var vmwareengine = {}; + + vmwareengine.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.vmwareengine + * @namespace + */ + var v1 = {}; + + v1.VmwareEngine = (function() { + + /** + * Constructs a new VmwareEngine service. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a VmwareEngine + * @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 VmwareEngine(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (VmwareEngine.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = VmwareEngine; + + /** + * Creates new VmwareEngine service using the specified rpc implementation. + * @function create + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @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 {VmwareEngine} RPC service. Useful where requests and/or responses are streamed. + */ + VmwareEngine.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listPrivateClouds}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListPrivateCloudsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} [response] ListPrivateCloudsResponse + */ + + /** + * Calls ListPrivateClouds. + * @function listPrivateClouds + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest} request ListPrivateCloudsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateCloudsCallback} callback Node-style callback called with the error, if any, and ListPrivateCloudsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listPrivateClouds = function listPrivateClouds(request, callback) { + return this.rpcCall(listPrivateClouds, $root.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest, $root.google.cloud.vmwareengine.v1.ListPrivateCloudsResponse, request, callback); + }, "name", { value: "ListPrivateClouds" }); + + /** + * Calls ListPrivateClouds. + * @function listPrivateClouds + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest} request ListPrivateCloudsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getPrivateCloud}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetPrivateCloudCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.PrivateCloud} [response] PrivateCloud + */ + + /** + * Calls GetPrivateCloud. + * @function getPrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest} request GetPrivateCloudRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloudCallback} callback Node-style callback called with the error, if any, and PrivateCloud + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getPrivateCloud = function getPrivateCloud(request, callback) { + return this.rpcCall(getPrivateCloud, $root.google.cloud.vmwareengine.v1.GetPrivateCloudRequest, $root.google.cloud.vmwareengine.v1.PrivateCloud, request, callback); + }, "name", { value: "GetPrivateCloud" }); + + /** + * Calls GetPrivateCloud. + * @function getPrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest} request GetPrivateCloudRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createPrivateCloud}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreatePrivateCloudCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreatePrivateCloud. + * @function createPrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest} request CreatePrivateCloudRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloudCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createPrivateCloud = function createPrivateCloud(request, callback) { + return this.rpcCall(createPrivateCloud, $root.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreatePrivateCloud" }); + + /** + * Calls CreatePrivateCloud. + * @function createPrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest} request CreatePrivateCloudRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updatePrivateCloud}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdatePrivateCloudCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdatePrivateCloud. + * @function updatePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest} request UpdatePrivateCloudRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloudCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updatePrivateCloud = function updatePrivateCloud(request, callback) { + return this.rpcCall(updatePrivateCloud, $root.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdatePrivateCloud" }); + + /** + * Calls UpdatePrivateCloud. + * @function updatePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest} request UpdatePrivateCloudRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deletePrivateCloud}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef DeletePrivateCloudCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeletePrivateCloud. + * @function deletePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest} request DeletePrivateCloudRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloudCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.deletePrivateCloud = function deletePrivateCloud(request, callback) { + return this.rpcCall(deletePrivateCloud, $root.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeletePrivateCloud" }); + + /** + * Calls DeletePrivateCloud. + * @function deletePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest} request DeletePrivateCloudRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|undeletePrivateCloud}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UndeletePrivateCloudCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UndeletePrivateCloud. + * @function undeletePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest} request UndeletePrivateCloudRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloudCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.undeletePrivateCloud = function undeletePrivateCloud(request, callback) { + return this.rpcCall(undeletePrivateCloud, $root.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UndeletePrivateCloud" }); + + /** + * Calls UndeletePrivateCloud. + * @function undeletePrivateCloud + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest} request UndeletePrivateCloudRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listClusters}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListClustersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListClustersResponse} [response] ListClustersResponse + */ + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListClustersCallback} callback Node-style callback called with the error, if any, and ListClustersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listClusters = function listClusters(request, callback) { + return this.rpcCall(listClusters, $root.google.cloud.vmwareengine.v1.ListClustersRequest, $root.google.cloud.vmwareengine.v1.ListClustersResponse, request, callback); + }, "name", { value: "ListClusters" }); + + /** + * Calls ListClusters. + * @function listClusters + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListClustersRequest} request ListClustersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getCluster}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.Cluster} [response] Cluster + */ + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetClusterCallback} callback Node-style callback called with the error, if any, and Cluster + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getCluster = function getCluster(request, callback) { + return this.rpcCall(getCluster, $root.google.cloud.vmwareengine.v1.GetClusterRequest, $root.google.cloud.vmwareengine.v1.Cluster, request, callback); + }, "name", { value: "GetCluster" }); + + /** + * Calls GetCluster. + * @function getCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest} request GetClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createCluster}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createCluster = function createCluster(request, callback) { + return this.rpcCall(createCluster, $root.google.cloud.vmwareengine.v1.CreateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateCluster" }); + + /** + * Calls CreateCluster. + * @function createCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest} request CreateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateCluster}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdateClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdateClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updateCluster = function updateCluster(request, callback) { + return this.rpcCall(updateCluster, $root.google.cloud.vmwareengine.v1.UpdateClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateCluster" }); + + /** + * Calls UpdateCluster. + * @function updateCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest} request UpdateClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteCluster}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef DeleteClusterCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.DeleteClusterCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.deleteCluster = function deleteCluster(request, callback) { + return this.rpcCall(deleteCluster, $root.google.cloud.vmwareengine.v1.DeleteClusterRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteCluster" }); + + /** + * Calls DeleteCluster. + * @function deleteCluster + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest} request DeleteClusterRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listSubnets}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListSubnetsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListSubnetsResponse} [response] ListSubnetsResponse + */ + + /** + * Calls ListSubnets. + * @function listSubnets + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest} request ListSubnetsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListSubnetsCallback} callback Node-style callback called with the error, if any, and ListSubnetsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listSubnets = function listSubnets(request, callback) { + return this.rpcCall(listSubnets, $root.google.cloud.vmwareengine.v1.ListSubnetsRequest, $root.google.cloud.vmwareengine.v1.ListSubnetsResponse, request, callback); + }, "name", { value: "ListSubnets" }); + + /** + * Calls ListSubnets. + * @function listSubnets + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest} request ListSubnetsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNodeTypes}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListNodeTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListNodeTypesResponse} [response] ListNodeTypesResponse + */ + + /** + * Calls ListNodeTypes. + * @function listNodeTypes + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} request ListNodeTypesRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypesCallback} callback Node-style callback called with the error, if any, and ListNodeTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listNodeTypes = function listNodeTypes(request, callback) { + return this.rpcCall(listNodeTypes, $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest, $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse, request, callback); + }, "name", { value: "ListNodeTypes" }); + + /** + * Calls ListNodeTypes. + * @function listNodeTypes + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} request ListNodeTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getNodeType}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetNodeTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.NodeType} [response] NodeType + */ + + /** + * Calls GetNodeType. + * @function getNodeType + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} request GetNodeTypeRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetNodeTypeCallback} callback Node-style callback called with the error, if any, and NodeType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getNodeType = function getNodeType(request, callback) { + return this.rpcCall(getNodeType, $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest, $root.google.cloud.vmwareengine.v1.NodeType, request, callback); + }, "name", { value: "GetNodeType" }); + + /** + * Calls GetNodeType. + * @function getNodeType + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} request GetNodeTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|showNsxCredentials}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ShowNsxCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.Credentials} [response] Credentials + */ + + /** + * Calls ShowNsxCredentials. + * @function showNsxCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} request ShowNsxCredentialsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentialsCallback} callback Node-style callback called with the error, if any, and Credentials + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.showNsxCredentials = function showNsxCredentials(request, callback) { + return this.rpcCall(showNsxCredentials, $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest, $root.google.cloud.vmwareengine.v1.Credentials, request, callback); + }, "name", { value: "ShowNsxCredentials" }); + + /** + * Calls ShowNsxCredentials. + * @function showNsxCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} request ShowNsxCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|showVcenterCredentials}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ShowVcenterCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.Credentials} [response] Credentials + */ + + /** + * Calls ShowVcenterCredentials. + * @function showVcenterCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} request ShowVcenterCredentialsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentialsCallback} callback Node-style callback called with the error, if any, and Credentials + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.showVcenterCredentials = function showVcenterCredentials(request, callback) { + return this.rpcCall(showVcenterCredentials, $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest, $root.google.cloud.vmwareengine.v1.Credentials, request, callback); + }, "name", { value: "ShowVcenterCredentials" }); + + /** + * Calls ShowVcenterCredentials. + * @function showVcenterCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} request ShowVcenterCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|resetNsxCredentials}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ResetNsxCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResetNsxCredentials. + * @function resetNsxCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} request ResetNsxCredentialsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentialsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.resetNsxCredentials = function resetNsxCredentials(request, callback) { + return this.rpcCall(resetNsxCredentials, $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResetNsxCredentials" }); + + /** + * Calls ResetNsxCredentials. + * @function resetNsxCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} request ResetNsxCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|resetVcenterCredentials}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ResetVcenterCredentialsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ResetVcenterCredentials. + * @function resetVcenterCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} request ResetVcenterCredentialsRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentialsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.resetVcenterCredentials = function resetVcenterCredentials(request, callback) { + return this.rpcCall(resetVcenterCredentials, $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ResetVcenterCredentials" }); + + /** + * Calls ResetVcenterCredentials. + * @function resetVcenterCredentials + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} request ResetVcenterCredentialsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createHcxActivationKey}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreateHcxActivationKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateHcxActivationKey. + * @function createHcxActivationKey + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} request CreateHcxActivationKeyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKeyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createHcxActivationKey = function createHcxActivationKey(request, callback) { + return this.rpcCall(createHcxActivationKey, $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateHcxActivationKey" }); + + /** + * Calls CreateHcxActivationKey. + * @function createHcxActivationKey + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} request CreateHcxActivationKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listHcxActivationKeys}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListHcxActivationKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} [response] ListHcxActivationKeysResponse + */ + + /** + * Calls ListHcxActivationKeys. + * @function listHcxActivationKeys + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} request ListHcxActivationKeysRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeysCallback} callback Node-style callback called with the error, if any, and ListHcxActivationKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listHcxActivationKeys = function listHcxActivationKeys(request, callback) { + return this.rpcCall(listHcxActivationKeys, $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest, $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse, request, callback); + }, "name", { value: "ListHcxActivationKeys" }); + + /** + * Calls ListHcxActivationKeys. + * @function listHcxActivationKeys + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} request ListHcxActivationKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getHcxActivationKey}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetHcxActivationKeyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.HcxActivationKey} [response] HcxActivationKey + */ + + /** + * Calls GetHcxActivationKey. + * @function getHcxActivationKey + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} request GetHcxActivationKeyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKeyCallback} callback Node-style callback called with the error, if any, and HcxActivationKey + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getHcxActivationKey = function getHcxActivationKey(request, callback) { + return this.rpcCall(getHcxActivationKey, $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest, $root.google.cloud.vmwareengine.v1.HcxActivationKey, request, callback); + }, "name", { value: "GetHcxActivationKey" }); + + /** + * Calls GetHcxActivationKey. + * @function getHcxActivationKey + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} request GetHcxActivationKeyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getNetworkPolicy}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetNetworkPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.NetworkPolicy} [response] NetworkPolicy + */ + + /** + * Calls GetNetworkPolicy. + * @function getNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} request GetNetworkPolicyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicyCallback} callback Node-style callback called with the error, if any, and NetworkPolicy + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getNetworkPolicy = function getNetworkPolicy(request, callback) { + return this.rpcCall(getNetworkPolicy, $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest, $root.google.cloud.vmwareengine.v1.NetworkPolicy, request, callback); + }, "name", { value: "GetNetworkPolicy" }); + + /** + * Calls GetNetworkPolicy. + * @function getNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} request GetNetworkPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listNetworkPolicies}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListNetworkPoliciesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} [response] ListNetworkPoliciesResponse + */ + + /** + * Calls ListNetworkPolicies. + * @function listNetworkPolicies + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} request ListNetworkPoliciesRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPoliciesCallback} callback Node-style callback called with the error, if any, and ListNetworkPoliciesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listNetworkPolicies = function listNetworkPolicies(request, callback) { + return this.rpcCall(listNetworkPolicies, $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest, $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse, request, callback); + }, "name", { value: "ListNetworkPolicies" }); + + /** + * Calls ListNetworkPolicies. + * @function listNetworkPolicies + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} request ListNetworkPoliciesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createNetworkPolicy}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreateNetworkPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateNetworkPolicy. + * @function createNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} request CreateNetworkPolicyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createNetworkPolicy = function createNetworkPolicy(request, callback) { + return this.rpcCall(createNetworkPolicy, $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateNetworkPolicy" }); + + /** + * Calls CreateNetworkPolicy. + * @function createNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} request CreateNetworkPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateNetworkPolicy}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdateNetworkPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateNetworkPolicy. + * @function updateNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} request UpdateNetworkPolicyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updateNetworkPolicy = function updateNetworkPolicy(request, callback) { + return this.rpcCall(updateNetworkPolicy, $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateNetworkPolicy" }); + + /** + * Calls UpdateNetworkPolicy. + * @function updateNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} request UpdateNetworkPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteNetworkPolicy}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef DeleteNetworkPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteNetworkPolicy. + * @function deleteNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} request DeleteNetworkPolicyRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicyCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.deleteNetworkPolicy = function deleteNetworkPolicy(request, callback) { + return this.rpcCall(deleteNetworkPolicy, $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteNetworkPolicy" }); + + /** + * Calls DeleteNetworkPolicy. + * @function deleteNetworkPolicy + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} request DeleteNetworkPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|createVmwareEngineNetwork}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef CreateVmwareEngineNetworkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateVmwareEngineNetwork. + * @function createVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} request CreateVmwareEngineNetworkRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetworkCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.createVmwareEngineNetwork = function createVmwareEngineNetwork(request, callback) { + return this.rpcCall(createVmwareEngineNetwork, $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateVmwareEngineNetwork" }); + + /** + * Calls CreateVmwareEngineNetwork. + * @function createVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} request CreateVmwareEngineNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|updateVmwareEngineNetwork}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef UpdateVmwareEngineNetworkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateVmwareEngineNetwork. + * @function updateVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} request UpdateVmwareEngineNetworkRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetworkCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.updateVmwareEngineNetwork = function updateVmwareEngineNetwork(request, callback) { + return this.rpcCall(updateVmwareEngineNetwork, $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateVmwareEngineNetwork" }); + + /** + * Calls UpdateVmwareEngineNetwork. + * @function updateVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} request UpdateVmwareEngineNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|deleteVmwareEngineNetwork}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef DeleteVmwareEngineNetworkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteVmwareEngineNetwork. + * @function deleteVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} request DeleteVmwareEngineNetworkRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetworkCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.deleteVmwareEngineNetwork = function deleteVmwareEngineNetwork(request, callback) { + return this.rpcCall(deleteVmwareEngineNetwork, $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteVmwareEngineNetwork" }); + + /** + * Calls DeleteVmwareEngineNetwork. + * @function deleteVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} request DeleteVmwareEngineNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|getVmwareEngineNetwork}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef GetVmwareEngineNetworkCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} [response] VmwareEngineNetwork + */ + + /** + * Calls GetVmwareEngineNetwork. + * @function getVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} request GetVmwareEngineNetworkRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetworkCallback} callback Node-style callback called with the error, if any, and VmwareEngineNetwork + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.getVmwareEngineNetwork = function getVmwareEngineNetwork(request, callback) { + return this.rpcCall(getVmwareEngineNetwork, $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest, $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork, request, callback); + }, "name", { value: "GetVmwareEngineNetwork" }); + + /** + * Calls GetVmwareEngineNetwork. + * @function getVmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} request GetVmwareEngineNetworkRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.vmwareengine.v1.VmwareEngine|listVmwareEngineNetworks}. + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @typedef ListVmwareEngineNetworksCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} [response] ListVmwareEngineNetworksResponse + */ + + /** + * Calls ListVmwareEngineNetworks. + * @function listVmwareEngineNetworks + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} request ListVmwareEngineNetworksRequest message or plain object + * @param {google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworksCallback} callback Node-style callback called with the error, if any, and ListVmwareEngineNetworksResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(VmwareEngine.prototype.listVmwareEngineNetworks = function listVmwareEngineNetworks(request, callback) { + return this.rpcCall(listVmwareEngineNetworks, $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest, $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse, request, callback); + }, "name", { value: "ListVmwareEngineNetworks" }); + + /** + * Calls ListVmwareEngineNetworks. + * @function listVmwareEngineNetworks + * @memberof google.cloud.vmwareengine.v1.VmwareEngine + * @instance + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} request ListVmwareEngineNetworksRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return VmwareEngine; + })(); + + v1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.vmwareengine.v1 + * @interface INetworkConfig + * @property {string|null} [managementCidr] NetworkConfig managementCidr + * @property {string|null} [vmwareEngineNetwork] NetworkConfig vmwareEngineNetwork + * @property {string|null} [vmwareEngineNetworkCanonical] NetworkConfig vmwareEngineNetworkCanonical + * @property {number|null} [managementIpAddressLayoutVersion] NetworkConfig managementIpAddressLayoutVersion + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig managementCidr. + * @member {string} managementCidr + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.managementCidr = ""; + + /** + * NetworkConfig vmwareEngineNetwork. + * @member {string} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.vmwareEngineNetwork = ""; + + /** + * NetworkConfig vmwareEngineNetworkCanonical. + * @member {string} vmwareEngineNetworkCanonical + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.vmwareEngineNetworkCanonical = ""; + + /** + * NetworkConfig managementIpAddressLayoutVersion. + * @member {number} managementIpAddressLayoutVersion + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.managementIpAddressLayoutVersion = 0; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managementCidr != null && Object.hasOwnProperty.call(message, "managementCidr")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.managementCidr); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.vmwareEngineNetwork); + if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.vmwareEngineNetworkCanonical); + if (message.managementIpAddressLayoutVersion != null && Object.hasOwnProperty.call(message, "managementIpAddressLayoutVersion")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.managementIpAddressLayoutVersion); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function 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.vmwareengine.v1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: { + message.managementCidr = reader.string(); + break; + } + case 5: { + message.vmwareEngineNetwork = reader.string(); + break; + } + case 6: { + message.vmwareEngineNetworkCanonical = reader.string(); + break; + } + case 8: { + message.managementIpAddressLayoutVersion = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) + if (!$util.isString(message.managementCidr)) + return "managementCidr: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + if (!$util.isString(message.vmwareEngineNetwork)) + return "vmwareEngineNetwork: string expected"; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + if (!$util.isString(message.vmwareEngineNetworkCanonical)) + return "vmwareEngineNetworkCanonical: string expected"; + if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) + if (!$util.isInteger(message.managementIpAddressLayoutVersion)) + return "managementIpAddressLayoutVersion: integer expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkConfig) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NetworkConfig(); + if (object.managementCidr != null) + message.managementCidr = String(object.managementCidr); + if (object.vmwareEngineNetwork != null) + message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); + if (object.vmwareEngineNetworkCanonical != null) + message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); + if (object.managementIpAddressLayoutVersion != null) + message.managementIpAddressLayoutVersion = object.managementIpAddressLayoutVersion | 0; + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {google.cloud.vmwareengine.v1.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.managementCidr = ""; + object.vmwareEngineNetwork = ""; + object.vmwareEngineNetworkCanonical = ""; + object.managementIpAddressLayoutVersion = 0; + } + if (message.managementCidr != null && message.hasOwnProperty("managementCidr")) + object.managementCidr = message.managementCidr; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = message.vmwareEngineNetwork; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + if (message.managementIpAddressLayoutVersion != null && message.hasOwnProperty("managementIpAddressLayoutVersion")) + object.managementIpAddressLayoutVersion = message.managementIpAddressLayoutVersion; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkConfig"; + }; + + return NetworkConfig; + })(); + + v1.NodeTypeConfig = (function() { + + /** + * Properties of a NodeTypeConfig. + * @memberof google.cloud.vmwareengine.v1 + * @interface INodeTypeConfig + * @property {number|null} [nodeCount] NodeTypeConfig nodeCount + * @property {number|null} [customCoreCount] NodeTypeConfig customCoreCount + */ + + /** + * Constructs a new NodeTypeConfig. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NodeTypeConfig. + * @implements INodeTypeConfig + * @constructor + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set + */ + function NodeTypeConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeTypeConfig nodeCount. + * @member {number} nodeCount + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + */ + NodeTypeConfig.prototype.nodeCount = 0; + + /** + * NodeTypeConfig customCoreCount. + * @member {number} customCoreCount + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + */ + NodeTypeConfig.prototype.customCoreCount = 0; + + /** + * Creates a new NodeTypeConfig instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig instance + */ + NodeTypeConfig.create = function create(properties) { + return new NodeTypeConfig(properties); + }; + + /** + * Encodes the specified NodeTypeConfig message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeCount != null && Object.hasOwnProperty.call(message, "nodeCount")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nodeCount); + if (message.customCoreCount != null && Object.hasOwnProperty.call(message, "customCoreCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.customCoreCount); + return writer; + }; + + /** + * Encodes the specified NodeTypeConfig message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeTypeConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.INodeTypeConfig} message NodeTypeConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeTypeConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeConfig.decode = function 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.vmwareengine.v1.NodeTypeConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.nodeCount = reader.int32(); + break; + } + case 2: { + message.customCoreCount = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeTypeConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeTypeConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeTypeConfig message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeTypeConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + if (!$util.isInteger(message.nodeCount)) + return "nodeCount: integer expected"; + if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) + if (!$util.isInteger(message.customCoreCount)) + return "customCoreCount: integer expected"; + return null; + }; + + /** + * Creates a NodeTypeConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NodeTypeConfig} NodeTypeConfig + */ + NodeTypeConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NodeTypeConfig) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NodeTypeConfig(); + if (object.nodeCount != null) + message.nodeCount = object.nodeCount | 0; + if (object.customCoreCount != null) + message.customCoreCount = object.customCoreCount | 0; + return message; + }; + + /** + * Creates a plain object from a NodeTypeConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {google.cloud.vmwareengine.v1.NodeTypeConfig} message NodeTypeConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeTypeConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.nodeCount = 0; + object.customCoreCount = 0; + } + if (message.nodeCount != null && message.hasOwnProperty("nodeCount")) + object.nodeCount = message.nodeCount; + if (message.customCoreCount != null && message.hasOwnProperty("customCoreCount")) + object.customCoreCount = message.customCoreCount; + return object; + }; + + /** + * Converts this NodeTypeConfig to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @instance + * @returns {Object.} JSON object + */ + NodeTypeConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeTypeConfig + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NodeTypeConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeTypeConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeTypeConfig"; + }; + + return NodeTypeConfig; + })(); + + v1.PrivateCloud = (function() { + + /** + * Properties of a PrivateCloud. + * @memberof google.cloud.vmwareengine.v1 + * @interface IPrivateCloud + * @property {string|null} [name] PrivateCloud name + * @property {google.protobuf.ITimestamp|null} [createTime] PrivateCloud createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] PrivateCloud updateTime + * @property {google.protobuf.ITimestamp|null} [deleteTime] PrivateCloud deleteTime + * @property {google.protobuf.ITimestamp|null} [expireTime] PrivateCloud expireTime + * @property {google.cloud.vmwareengine.v1.PrivateCloud.State|null} [state] PrivateCloud state + * @property {google.cloud.vmwareengine.v1.INetworkConfig|null} [networkConfig] PrivateCloud networkConfig + * @property {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null} [managementCluster] PrivateCloud managementCluster + * @property {string|null} [description] PrivateCloud description + * @property {google.cloud.vmwareengine.v1.IHcx|null} [hcx] PrivateCloud hcx + * @property {google.cloud.vmwareengine.v1.INsx|null} [nsx] PrivateCloud nsx + * @property {google.cloud.vmwareengine.v1.IVcenter|null} [vcenter] PrivateCloud vcenter + * @property {string|null} [uid] PrivateCloud uid + */ + + /** + * Constructs a new PrivateCloud. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a PrivateCloud. + * @implements IPrivateCloud + * @constructor + * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set + */ + function PrivateCloud(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PrivateCloud name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.name = ""; + + /** + * PrivateCloud createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.createTime = null; + + /** + * PrivateCloud updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.updateTime = null; + + /** + * PrivateCloud deleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} deleteTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.deleteTime = null; + + /** + * PrivateCloud expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.expireTime = null; + + /** + * PrivateCloud state. + * @member {google.cloud.vmwareengine.v1.PrivateCloud.State} state + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.state = 0; + + /** + * PrivateCloud networkConfig. + * @member {google.cloud.vmwareengine.v1.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.networkConfig = null; + + /** + * PrivateCloud managementCluster. + * @member {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster|null|undefined} managementCluster + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.managementCluster = null; + + /** + * PrivateCloud description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.description = ""; + + /** + * PrivateCloud hcx. + * @member {google.cloud.vmwareengine.v1.IHcx|null|undefined} hcx + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.hcx = null; + + /** + * PrivateCloud nsx. + * @member {google.cloud.vmwareengine.v1.INsx|null|undefined} nsx + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.nsx = null; + + /** + * PrivateCloud vcenter. + * @member {google.cloud.vmwareengine.v1.IVcenter|null|undefined} vcenter + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.vcenter = null; + + /** + * PrivateCloud uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + */ + PrivateCloud.prototype.uid = ""; + + /** + * Creates a new PrivateCloud instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud instance + */ + PrivateCloud.create = function create(properties) { + return new PrivateCloud(properties); + }; + + /** + * Encodes the specified PrivateCloud message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateCloud.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.deleteTime != null && Object.hasOwnProperty.call(message, "deleteTime")) + $root.google.protobuf.Timestamp.encode(message.deleteTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.state); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.vmwareengine.v1.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.managementCluster != null && Object.hasOwnProperty.call(message, "managementCluster")) + $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.encode(message.managementCluster, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.description); + if (message.hcx != null && Object.hasOwnProperty.call(message, "hcx")) + $root.google.cloud.vmwareengine.v1.Hcx.encode(message.hcx, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.nsx != null && Object.hasOwnProperty.call(message, "nsx")) + $root.google.cloud.vmwareengine.v1.Nsx.encode(message.nsx, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.vcenter != null && Object.hasOwnProperty.call(message, "vcenter")) + $root.google.cloud.vmwareengine.v1.Vcenter.encode(message.vcenter, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.uid); + return writer; + }; + + /** + * Encodes the specified PrivateCloud message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.IPrivateCloud} message PrivateCloud message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PrivateCloud.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateCloud.decode = function 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.vmwareengine.v1.PrivateCloud(); + 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.deleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.state = reader.int32(); + break; + } + case 9: { + message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 10: { + message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.decode(reader, reader.uint32()); + break; + } + case 11: { + message.description = reader.string(); + break; + } + case 17: { + message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.decode(reader, reader.uint32()); + break; + } + case 18: { + message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.decode(reader, reader.uint32()); + break; + } + case 19: { + message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.decode(reader, reader.uint32()); + break; + } + case 20: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PrivateCloud message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PrivateCloud.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PrivateCloud message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PrivateCloud.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.deleteTime != null && message.hasOwnProperty("deleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.deleteTime); + if (error) + return "deleteTime." + error; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + 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 5: + case 6: + case 7: + break; + } + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify(message.managementCluster); + if (error) + return "managementCluster." + error; + } + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.hcx != null && message.hasOwnProperty("hcx")) { + var error = $root.google.cloud.vmwareengine.v1.Hcx.verify(message.hcx); + if (error) + return "hcx." + error; + } + if (message.nsx != null && message.hasOwnProperty("nsx")) { + var error = $root.google.cloud.vmwareengine.v1.Nsx.verify(message.nsx); + if (error) + return "nsx." + error; + } + if (message.vcenter != null && message.hasOwnProperty("vcenter")) { + var error = $root.google.cloud.vmwareengine.v1.Vcenter.verify(message.vcenter); + if (error) + return "vcenter." + error; + } + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; + + /** + * Creates a PrivateCloud message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.PrivateCloud} PrivateCloud + */ + PrivateCloud.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud) + return object; + var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.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.vmwareengine.v1.PrivateCloud.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.deleteTime != null) { + if (typeof object.deleteTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.deleteTime: object expected"); + message.deleteTime = $root.google.protobuf.Timestamp.fromObject(object.deleteTime); + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "FAILED": + case 5: + message.state = 5; + break; + case "DELETED": + case 6: + message.state = 6; + break; + case "PURGING": + case 7: + message.state = 7; + break; + } + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.fromObject(object.networkConfig); + } + if (object.managementCluster != null) { + if (typeof object.managementCluster !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.managementCluster: object expected"); + message.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.fromObject(object.managementCluster); + } + if (object.description != null) + message.description = String(object.description); + if (object.hcx != null) { + if (typeof object.hcx !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.hcx: object expected"); + message.hcx = $root.google.cloud.vmwareengine.v1.Hcx.fromObject(object.hcx); + } + if (object.nsx != null) { + if (typeof object.nsx !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.nsx: object expected"); + message.nsx = $root.google.cloud.vmwareengine.v1.Nsx.fromObject(object.nsx); + } + if (object.vcenter != null) { + if (typeof object.vcenter !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.vcenter: object expected"); + message.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.fromObject(object.vcenter); + } + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; + + /** + * Creates a plain object from a PrivateCloud message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud} message PrivateCloud + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PrivateCloud.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.deleteTime = null; + object.expireTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.networkConfig = null; + object.managementCluster = null; + object.description = ""; + object.hcx = null; + object.nsx = null; + object.vcenter = null; + object.uid = ""; + } + 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.deleteTime != null && message.hasOwnProperty("deleteTime")) + object.deleteTime = $root.google.protobuf.Timestamp.toObject(message.deleteTime, options); + if (message.expireTime != null && message.hasOwnProperty("expireTime")) + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.PrivateCloud.State[message.state] : message.state; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.vmwareengine.v1.NetworkConfig.toObject(message.networkConfig, options); + if (message.managementCluster != null && message.hasOwnProperty("managementCluster")) + object.managementCluster = $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.toObject(message.managementCluster, options); + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.hcx != null && message.hasOwnProperty("hcx")) + object.hcx = $root.google.cloud.vmwareengine.v1.Hcx.toObject(message.hcx, options); + if (message.nsx != null && message.hasOwnProperty("nsx")) + object.nsx = $root.google.cloud.vmwareengine.v1.Nsx.toObject(message.nsx, options); + if (message.vcenter != null && message.hasOwnProperty("vcenter")) + object.vcenter = $root.google.cloud.vmwareengine.v1.Vcenter.toObject(message.vcenter, options); + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; + + /** + * Converts this PrivateCloud to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @instance + * @returns {Object.} JSON object + */ + PrivateCloud.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PrivateCloud + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PrivateCloud.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.PrivateCloud.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} FAILED=5 FAILED value + * @property {number} DELETED=6 DELETED value + * @property {number} PURGING=7 PURGING value + */ + PrivateCloud.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[5] = "FAILED"] = 5; + values[valuesById[6] = "DELETED"] = 6; + values[valuesById[7] = "PURGING"] = 7; + return values; + })(); + + PrivateCloud.ManagementCluster = (function() { + + /** + * Properties of a ManagementCluster. + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @interface IManagementCluster + * @property {string|null} [clusterId] ManagementCluster clusterId + * @property {Object.|null} [nodeTypeConfigs] ManagementCluster nodeTypeConfigs + */ + + /** + * Constructs a new ManagementCluster. + * @memberof google.cloud.vmwareengine.v1.PrivateCloud + * @classdesc Represents a ManagementCluster. + * @implements IManagementCluster + * @constructor + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set + */ + function ManagementCluster(properties) { + this.nodeTypeConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagementCluster clusterId. + * @member {string} clusterId + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + */ + ManagementCluster.prototype.clusterId = ""; + + /** + * ManagementCluster nodeTypeConfigs. + * @member {Object.} nodeTypeConfigs + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + */ + ManagementCluster.prototype.nodeTypeConfigs = $util.emptyObject; + + /** + * Creates a new ManagementCluster instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster instance + */ + ManagementCluster.create = function create(properties) { + return new ManagementCluster(properties); + }; + + /** + * Encodes the specified ManagementCluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementCluster.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.clusterId); + if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) + for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ManagementCluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.IManagementCluster} message ManagementCluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementCluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementCluster.decode = function 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.vmwareengine.v1.PrivateCloud.ManagementCluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.clusterId = reader.string(); + break; + } + case 7: { + if (message.nodeTypeConfigs === $util.emptyObject) + message.nodeTypeConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.nodeTypeConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagementCluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementCluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagementCluster message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagementCluster.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { + if (!$util.isObject(message.nodeTypeConfigs)) + return "nodeTypeConfigs: object expected"; + var key = Object.keys(message.nodeTypeConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); + if (error) + return "nodeTypeConfigs." + error; + } + } + return null; + }; + + /** + * Creates a ManagementCluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} ManagementCluster + */ + ManagementCluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster) + return object; + var message = new $root.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster(); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.nodeTypeConfigs) { + if (typeof object.nodeTypeConfigs !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs = {}; + for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.nodeTypeConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a ManagementCluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster} message ManagementCluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagementCluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.nodeTypeConfigs = {}; + if (options.defaults) + object.clusterId = ""; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + var keys2; + if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { + object.nodeTypeConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this ManagementCluster to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @instance + * @returns {Object.} JSON object + */ + ManagementCluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagementCluster + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagementCluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster"; + }; + + return ManagementCluster; + })(); + + return PrivateCloud; + })(); + + v1.ListPrivateCloudsRequest = (function() { + + /** + * Properties of a ListPrivateCloudsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateCloudsRequest + * @property {string|null} [parent] ListPrivateCloudsRequest parent + * @property {number|null} [pageSize] ListPrivateCloudsRequest pageSize + * @property {string|null} [pageToken] ListPrivateCloudsRequest pageToken + * @property {string|null} [filter] ListPrivateCloudsRequest filter + * @property {string|null} [orderBy] ListPrivateCloudsRequest orderBy + */ + + /** + * Constructs a new ListPrivateCloudsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateCloudsRequest. + * @implements IListPrivateCloudsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest=} [properties] Properties to set + */ + function ListPrivateCloudsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListPrivateCloudsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + */ + ListPrivateCloudsRequest.prototype.parent = ""; + + /** + * ListPrivateCloudsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + */ + ListPrivateCloudsRequest.prototype.pageSize = 0; + + /** + * ListPrivateCloudsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + */ + ListPrivateCloudsRequest.prototype.pageToken = ""; + + /** + * ListPrivateCloudsRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + */ + ListPrivateCloudsRequest.prototype.filter = ""; + + /** + * ListPrivateCloudsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + */ + ListPrivateCloudsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListPrivateCloudsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsRequest} ListPrivateCloudsRequest instance + */ + ListPrivateCloudsRequest.create = function create(properties) { + return new ListPrivateCloudsRequest(properties); + }; + + /** + * Encodes the specified ListPrivateCloudsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest} message ListPrivateCloudsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateCloudsRequest.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 ListPrivateCloudsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsRequest} message ListPrivateCloudsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateCloudsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateCloudsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsRequest} ListPrivateCloudsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateCloudsRequest.decode = function 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.vmwareengine.v1.ListPrivateCloudsRequest(); + 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 ListPrivateCloudsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsRequest} ListPrivateCloudsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateCloudsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrivateCloudsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateCloudsRequest.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 ListPrivateCloudsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsRequest} ListPrivateCloudsRequest + */ + ListPrivateCloudsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest(); + 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 ListPrivateCloudsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateCloudsRequest} message ListPrivateCloudsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateCloudsRequest.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 ListPrivateCloudsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @instance + * @returns {Object.} JSON object + */ + ListPrivateCloudsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateCloudsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateCloudsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateCloudsRequest"; + }; + + return ListPrivateCloudsRequest; + })(); + + v1.ListPrivateCloudsResponse = (function() { + + /** + * Properties of a ListPrivateCloudsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListPrivateCloudsResponse + * @property {Array.|null} [privateClouds] ListPrivateCloudsResponse privateClouds + * @property {string|null} [nextPageToken] ListPrivateCloudsResponse nextPageToken + * @property {Array.|null} [unreachable] ListPrivateCloudsResponse unreachable + */ + + /** + * Constructs a new ListPrivateCloudsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListPrivateCloudsResponse. + * @implements IListPrivateCloudsResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsResponse=} [properties] Properties to set + */ + function ListPrivateCloudsResponse(properties) { + this.privateClouds = []; + 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]]; + } + + /** + * ListPrivateCloudsResponse privateClouds. + * @member {Array.} privateClouds + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @instance + */ + ListPrivateCloudsResponse.prototype.privateClouds = $util.emptyArray; + + /** + * ListPrivateCloudsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @instance + */ + ListPrivateCloudsResponse.prototype.nextPageToken = ""; + + /** + * ListPrivateCloudsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @instance + */ + ListPrivateCloudsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListPrivateCloudsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} ListPrivateCloudsResponse instance + */ + ListPrivateCloudsResponse.create = function create(properties) { + return new ListPrivateCloudsResponse(properties); + }; + + /** + * Encodes the specified ListPrivateCloudsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsResponse} message ListPrivateCloudsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateCloudsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateClouds != null && message.privateClouds.length) + for (var i = 0; i < message.privateClouds.length; ++i) + $root.google.cloud.vmwareengine.v1.PrivateCloud.encode(message.privateClouds[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 ListPrivateCloudsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListPrivateCloudsResponse} message ListPrivateCloudsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListPrivateCloudsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListPrivateCloudsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} ListPrivateCloudsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateCloudsResponse.decode = function 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.vmwareengine.v1.ListPrivateCloudsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.privateClouds && message.privateClouds.length)) + message.privateClouds = []; + message.privateClouds.push($root.google.cloud.vmwareengine.v1.PrivateCloud.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 ListPrivateCloudsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} ListPrivateCloudsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListPrivateCloudsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListPrivateCloudsResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListPrivateCloudsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateClouds != null && message.hasOwnProperty("privateClouds")) { + if (!Array.isArray(message.privateClouds)) + return "privateClouds: array expected"; + for (var i = 0; i < message.privateClouds.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.verify(message.privateClouds[i]); + if (error) + return "privateClouds." + 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 ListPrivateCloudsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} ListPrivateCloudsResponse + */ + ListPrivateCloudsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListPrivateCloudsResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListPrivateCloudsResponse(); + if (object.privateClouds) { + if (!Array.isArray(object.privateClouds)) + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.privateClouds: array expected"); + message.privateClouds = []; + for (var i = 0; i < object.privateClouds.length; ++i) { + if (typeof object.privateClouds[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.privateClouds: object expected"); + message.privateClouds[i] = $root.google.cloud.vmwareengine.v1.PrivateCloud.fromObject(object.privateClouds[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListPrivateCloudsResponse.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 ListPrivateCloudsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListPrivateCloudsResponse} message ListPrivateCloudsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListPrivateCloudsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.privateClouds = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.privateClouds && message.privateClouds.length) { + object.privateClouds = []; + for (var j = 0; j < message.privateClouds.length; ++j) + object.privateClouds[j] = $root.google.cloud.vmwareengine.v1.PrivateCloud.toObject(message.privateClouds[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 ListPrivateCloudsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @instance + * @returns {Object.} JSON object + */ + ListPrivateCloudsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListPrivateCloudsResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListPrivateCloudsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListPrivateCloudsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListPrivateCloudsResponse"; + }; + + return ListPrivateCloudsResponse; + })(); + + v1.GetPrivateCloudRequest = (function() { + + /** + * Properties of a GetPrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetPrivateCloudRequest + * @property {string|null} [name] GetPrivateCloudRequest name + */ + + /** + * Constructs a new GetPrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetPrivateCloudRequest. + * @implements IGetPrivateCloudRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest=} [properties] Properties to set + */ + function GetPrivateCloudRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetPrivateCloudRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @instance + */ + GetPrivateCloudRequest.prototype.name = ""; + + /** + * Creates a new GetPrivateCloudRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetPrivateCloudRequest} GetPrivateCloudRequest instance + */ + GetPrivateCloudRequest.create = function create(properties) { + return new GetPrivateCloudRequest(properties); + }; + + /** + * Encodes the specified GetPrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateCloudRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest} message GetPrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrivateCloudRequest.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 GetPrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetPrivateCloudRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetPrivateCloudRequest} message GetPrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetPrivateCloudRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetPrivateCloudRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetPrivateCloudRequest} GetPrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrivateCloudRequest.decode = function 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.vmwareengine.v1.GetPrivateCloudRequest(); + 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 GetPrivateCloudRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetPrivateCloudRequest} GetPrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetPrivateCloudRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetPrivateCloudRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetPrivateCloudRequest.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 GetPrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetPrivateCloudRequest} GetPrivateCloudRequest + */ + GetPrivateCloudRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetPrivateCloudRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetPrivateCloudRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetPrivateCloudRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetPrivateCloudRequest} message GetPrivateCloudRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetPrivateCloudRequest.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 GetPrivateCloudRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @instance + * @returns {Object.} JSON object + */ + GetPrivateCloudRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetPrivateCloudRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetPrivateCloudRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetPrivateCloudRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetPrivateCloudRequest"; + }; + + return GetPrivateCloudRequest; + })(); + + v1.CreatePrivateCloudRequest = (function() { + + /** + * Properties of a CreatePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICreatePrivateCloudRequest + * @property {string|null} [parent] CreatePrivateCloudRequest parent + * @property {string|null} [privateCloudId] CreatePrivateCloudRequest privateCloudId + * @property {google.cloud.vmwareengine.v1.IPrivateCloud|null} [privateCloud] CreatePrivateCloudRequest privateCloud + * @property {string|null} [requestId] CreatePrivateCloudRequest requestId + * @property {boolean|null} [validateOnly] CreatePrivateCloudRequest validateOnly + */ + + /** + * Constructs a new CreatePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a CreatePrivateCloudRequest. + * @implements ICreatePrivateCloudRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest=} [properties] Properties to set + */ + function CreatePrivateCloudRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreatePrivateCloudRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + */ + CreatePrivateCloudRequest.prototype.parent = ""; + + /** + * CreatePrivateCloudRequest privateCloudId. + * @member {string} privateCloudId + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + */ + CreatePrivateCloudRequest.prototype.privateCloudId = ""; + + /** + * CreatePrivateCloudRequest privateCloud. + * @member {google.cloud.vmwareengine.v1.IPrivateCloud|null|undefined} privateCloud + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + */ + CreatePrivateCloudRequest.prototype.privateCloud = null; + + /** + * CreatePrivateCloudRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + */ + CreatePrivateCloudRequest.prototype.requestId = ""; + + /** + * CreatePrivateCloudRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + */ + CreatePrivateCloudRequest.prototype.validateOnly = false; + + /** + * Creates a new CreatePrivateCloudRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreatePrivateCloudRequest} CreatePrivateCloudRequest instance + */ + CreatePrivateCloudRequest.create = function create(properties) { + return new CreatePrivateCloudRequest(properties); + }; + + /** + * Encodes the specified CreatePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateCloudRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest} message CreatePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePrivateCloudRequest.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.privateCloudId != null && Object.hasOwnProperty.call(message, "privateCloudId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.privateCloudId); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + $root.google.cloud.vmwareengine.v1.PrivateCloud.encode(message.privateCloud, 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); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreatePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreatePrivateCloudRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest} message CreatePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreatePrivateCloudRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreatePrivateCloudRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreatePrivateCloudRequest} CreatePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePrivateCloudRequest.decode = function 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.vmwareengine.v1.CreatePrivateCloudRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.privateCloudId = reader.string(); + break; + } + case 3: { + message.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreatePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreatePrivateCloudRequest} CreatePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreatePrivateCloudRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreatePrivateCloudRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreatePrivateCloudRequest.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.privateCloudId != null && message.hasOwnProperty("privateCloudId")) + if (!$util.isString(message.privateCloudId)) + return "privateCloudId: string expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.verify(message.privateCloud); + if (error) + return "privateCloud." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreatePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreatePrivateCloudRequest} CreatePrivateCloudRequest + */ + CreatePrivateCloudRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.privateCloudId != null) + message.privateCloudId = String(object.privateCloudId); + if (object.privateCloud != null) { + if (typeof object.privateCloud !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreatePrivateCloudRequest.privateCloud: object expected"); + message.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.fromObject(object.privateCloud); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreatePrivateCloudRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreatePrivateCloudRequest} message CreatePrivateCloudRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreatePrivateCloudRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.privateCloudId = ""; + object.privateCloud = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.privateCloudId != null && message.hasOwnProperty("privateCloudId")) + object.privateCloudId = message.privateCloudId; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.toObject(message.privateCloud, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreatePrivateCloudRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @instance + * @returns {Object.} JSON object + */ + CreatePrivateCloudRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreatePrivateCloudRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreatePrivateCloudRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreatePrivateCloudRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreatePrivateCloudRequest"; + }; + + return CreatePrivateCloudRequest; + })(); + + v1.UpdatePrivateCloudRequest = (function() { + + /** + * Properties of an UpdatePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUpdatePrivateCloudRequest + * @property {google.cloud.vmwareengine.v1.IPrivateCloud|null} [privateCloud] UpdatePrivateCloudRequest privateCloud + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdatePrivateCloudRequest updateMask + * @property {string|null} [requestId] UpdatePrivateCloudRequest requestId + */ + + /** + * Constructs a new UpdatePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UpdatePrivateCloudRequest. + * @implements IUpdatePrivateCloudRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest=} [properties] Properties to set + */ + function UpdatePrivateCloudRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdatePrivateCloudRequest privateCloud. + * @member {google.cloud.vmwareengine.v1.IPrivateCloud|null|undefined} privateCloud + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @instance + */ + UpdatePrivateCloudRequest.prototype.privateCloud = null; + + /** + * UpdatePrivateCloudRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @instance + */ + UpdatePrivateCloudRequest.prototype.updateMask = null; + + /** + * UpdatePrivateCloudRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @instance + */ + UpdatePrivateCloudRequest.prototype.requestId = ""; + + /** + * Creates a new UpdatePrivateCloudRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest} UpdatePrivateCloudRequest instance + */ + UpdatePrivateCloudRequest.create = function create(properties) { + return new UpdatePrivateCloudRequest(properties); + }; + + /** + * Encodes the specified UpdatePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest} message UpdatePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePrivateCloudRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + $root.google.cloud.vmwareengine.v1.PrivateCloud.encode(message.privateCloud, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdatePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest} message UpdatePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdatePrivateCloudRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdatePrivateCloudRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest} UpdatePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePrivateCloudRequest.decode = function 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.vmwareengine.v1.UpdatePrivateCloudRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdatePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest} UpdatePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdatePrivateCloudRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdatePrivateCloudRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdatePrivateCloudRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) { + var error = $root.google.cloud.vmwareengine.v1.PrivateCloud.verify(message.privateCloud); + if (error) + return "privateCloud." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdatePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest} UpdatePrivateCloudRequest + */ + UpdatePrivateCloudRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest(); + if (object.privateCloud != null) { + if (typeof object.privateCloud !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.privateCloud: object expected"); + message.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.fromObject(object.privateCloud); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdatePrivateCloudRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest} message UpdatePrivateCloudRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdatePrivateCloudRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateCloud = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = $root.google.cloud.vmwareengine.v1.PrivateCloud.toObject(message.privateCloud, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdatePrivateCloudRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @instance + * @returns {Object.} JSON object + */ + UpdatePrivateCloudRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdatePrivateCloudRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdatePrivateCloudRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest"; + }; + + return UpdatePrivateCloudRequest; + })(); + + v1.DeletePrivateCloudRequest = (function() { + + /** + * Properties of a DeletePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IDeletePrivateCloudRequest + * @property {string|null} [name] DeletePrivateCloudRequest name + * @property {string|null} [requestId] DeletePrivateCloudRequest requestId + * @property {boolean|null} [force] DeletePrivateCloudRequest force + * @property {number|null} [delayHours] DeletePrivateCloudRequest delayHours + */ + + /** + * Constructs a new DeletePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a DeletePrivateCloudRequest. + * @implements IDeletePrivateCloudRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest=} [properties] Properties to set + */ + function DeletePrivateCloudRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeletePrivateCloudRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + */ + DeletePrivateCloudRequest.prototype.name = ""; + + /** + * DeletePrivateCloudRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + */ + DeletePrivateCloudRequest.prototype.requestId = ""; + + /** + * DeletePrivateCloudRequest force. + * @member {boolean} force + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + */ + DeletePrivateCloudRequest.prototype.force = false; + + /** + * DeletePrivateCloudRequest delayHours. + * @member {number|null|undefined} delayHours + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + */ + DeletePrivateCloudRequest.prototype.delayHours = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DeletePrivateCloudRequest _delayHours. + * @member {"delayHours"|undefined} _delayHours + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + */ + Object.defineProperty(DeletePrivateCloudRequest.prototype, "_delayHours", { + get: $util.oneOfGetter($oneOfFields = ["delayHours"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DeletePrivateCloudRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeletePrivateCloudRequest} DeletePrivateCloudRequest instance + */ + DeletePrivateCloudRequest.create = function create(properties) { + return new DeletePrivateCloudRequest(properties); + }; + + /** + * Encodes the specified DeletePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateCloudRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest} message DeletePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePrivateCloudRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.delayHours != null && Object.hasOwnProperty.call(message, "delayHours")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.delayHours); + return writer; + }; + + /** + * Encodes the specified DeletePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeletePrivateCloudRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest} message DeletePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeletePrivateCloudRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeletePrivateCloudRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.DeletePrivateCloudRequest} DeletePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePrivateCloudRequest.decode = function 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.vmwareengine.v1.DeletePrivateCloudRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.delayHours = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeletePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.DeletePrivateCloudRequest} DeletePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeletePrivateCloudRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeletePrivateCloudRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeletePrivateCloudRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.delayHours != null && message.hasOwnProperty("delayHours")) { + properties._delayHours = 1; + if (!$util.isInteger(message.delayHours)) + return "delayHours: integer expected"; + } + return null; + }; + + /** + * Creates a DeletePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.DeletePrivateCloudRequest} DeletePrivateCloudRequest + */ + DeletePrivateCloudRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + if (object.delayHours != null) + message.delayHours = object.delayHours | 0; + return message; + }; + + /** + * Creates a plain object from a DeletePrivateCloudRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.DeletePrivateCloudRequest} message DeletePrivateCloudRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeletePrivateCloudRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.delayHours != null && message.hasOwnProperty("delayHours")) { + object.delayHours = message.delayHours; + if (options.oneofs) + object._delayHours = "delayHours"; + } + return object; + }; + + /** + * Converts this DeletePrivateCloudRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @instance + * @returns {Object.} JSON object + */ + DeletePrivateCloudRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeletePrivateCloudRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.DeletePrivateCloudRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeletePrivateCloudRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeletePrivateCloudRequest"; + }; + + return DeletePrivateCloudRequest; + })(); + + v1.UndeletePrivateCloudRequest = (function() { + + /** + * Properties of an UndeletePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUndeletePrivateCloudRequest + * @property {string|null} [name] UndeletePrivateCloudRequest name + * @property {string|null} [requestId] UndeletePrivateCloudRequest requestId + */ + + /** + * Constructs a new UndeletePrivateCloudRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UndeletePrivateCloudRequest. + * @implements IUndeletePrivateCloudRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest=} [properties] Properties to set + */ + function UndeletePrivateCloudRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UndeletePrivateCloudRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @instance + */ + UndeletePrivateCloudRequest.prototype.name = ""; + + /** + * UndeletePrivateCloudRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @instance + */ + UndeletePrivateCloudRequest.prototype.requestId = ""; + + /** + * Creates a new UndeletePrivateCloudRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest} UndeletePrivateCloudRequest instance + */ + UndeletePrivateCloudRequest.create = function create(properties) { + return new UndeletePrivateCloudRequest(properties); + }; + + /** + * Encodes the specified UndeletePrivateCloudRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest} message UndeletePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeletePrivateCloudRequest.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 UndeletePrivateCloudRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest} message UndeletePrivateCloudRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UndeletePrivateCloudRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UndeletePrivateCloudRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest} UndeletePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeletePrivateCloudRequest.decode = function 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.vmwareengine.v1.UndeletePrivateCloudRequest(); + 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 an UndeletePrivateCloudRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest} UndeletePrivateCloudRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UndeletePrivateCloudRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UndeletePrivateCloudRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UndeletePrivateCloudRequest.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 an UndeletePrivateCloudRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest} UndeletePrivateCloudRequest + */ + UndeletePrivateCloudRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest(); + 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 an UndeletePrivateCloudRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest} message UndeletePrivateCloudRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UndeletePrivateCloudRequest.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 UndeletePrivateCloudRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @instance + * @returns {Object.} JSON object + */ + UndeletePrivateCloudRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UndeletePrivateCloudRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UndeletePrivateCloudRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest"; + }; + + return UndeletePrivateCloudRequest; + })(); + + v1.Cluster = (function() { + + /** + * Properties of a Cluster. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICluster + * @property {string|null} [name] Cluster name + * @property {google.protobuf.ITimestamp|null} [createTime] Cluster createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Cluster updateTime + * @property {google.cloud.vmwareengine.v1.Cluster.State|null} [state] Cluster state + * @property {boolean|null} [management] Cluster management + * @property {string|null} [uid] Cluster uid + * @property {Object.|null} [nodeTypeConfigs] Cluster nodeTypeConfigs + */ + + /** + * Constructs a new Cluster. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Cluster. + * @implements ICluster + * @constructor + * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set + */ + function Cluster(properties) { + this.nodeTypeConfigs = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Cluster name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.name = ""; + + /** + * Cluster createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.createTime = null; + + /** + * Cluster updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.updateTime = null; + + /** + * Cluster state. + * @member {google.cloud.vmwareengine.v1.Cluster.State} state + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.state = 0; + + /** + * Cluster management. + * @member {boolean} management + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.management = false; + + /** + * Cluster uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.uid = ""; + + /** + * Cluster nodeTypeConfigs. + * @member {Object.} nodeTypeConfigs + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + */ + Cluster.prototype.nodeTypeConfigs = $util.emptyObject; + + /** + * Creates a new Cluster instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster instance + */ + Cluster.create = function create(properties) { + return new Cluster(properties); + }; + + /** + * Encodes the specified Cluster message. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); + if (message.management != null && Object.hasOwnProperty.call(message, "management")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.management); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.uid); + if (message.nodeTypeConfigs != null && Object.hasOwnProperty.call(message, "nodeTypeConfigs")) + for (var keys = Object.keys(message.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 16, wireType 2 =*/130).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.cloud.vmwareengine.v1.NodeTypeConfig.encode(message.nodeTypeConfigs[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Cluster message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Cluster.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.ICluster} message Cluster message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Cluster.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Cluster message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decode = function 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.vmwareengine.v1.Cluster(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { + message.management = reader.bool(); + break; + } + case 14: { + message.uid = reader.string(); + break; + } + case 16: { + if (message.nodeTypeConfigs === $util.emptyObject) + message.nodeTypeConfigs = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.nodeTypeConfigs[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Cluster message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Cluster.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Cluster message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Cluster.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.management != null && message.hasOwnProperty("management")) + if (typeof message.management !== "boolean") + return "management: boolean expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.nodeTypeConfigs != null && message.hasOwnProperty("nodeTypeConfigs")) { + if (!$util.isObject(message.nodeTypeConfigs)) + return "nodeTypeConfigs: object expected"; + var key = Object.keys(message.nodeTypeConfigs); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.verify(message.nodeTypeConfigs[key[i]]); + if (error) + return "nodeTypeConfigs." + error; + } + } + return null; + }; + + /** + * Creates a Cluster message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Cluster} Cluster + */ + Cluster.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Cluster) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Cluster(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.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.vmwareengine.v1.Cluster.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "REPAIRING": + case 5: + message.state = 5; + break; + } + if (object.management != null) + message.management = Boolean(object.management); + if (object.uid != null) + message.uid = String(object.uid); + if (object.nodeTypeConfigs) { + if (typeof object.nodeTypeConfigs !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs = {}; + for (var keys = Object.keys(object.nodeTypeConfigs), i = 0; i < keys.length; ++i) { + if (typeof object.nodeTypeConfigs[keys[i]] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.Cluster.nodeTypeConfigs: object expected"); + message.nodeTypeConfigs[keys[i]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.fromObject(object.nodeTypeConfigs[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Cluster message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {google.cloud.vmwareengine.v1.Cluster} message Cluster + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Cluster.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.nodeTypeConfigs = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.management = false; + object.uid = ""; + } + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Cluster.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Cluster.State[message.state] : message.state; + if (message.management != null && message.hasOwnProperty("management")) + object.management = message.management; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + var keys2; + if (message.nodeTypeConfigs && (keys2 = Object.keys(message.nodeTypeConfigs)).length) { + object.nodeTypeConfigs = {}; + for (var j = 0; j < keys2.length; ++j) + object.nodeTypeConfigs[keys2[j]] = $root.google.cloud.vmwareengine.v1.NodeTypeConfig.toObject(message.nodeTypeConfigs[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Cluster to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Cluster + * @instance + * @returns {Object.} JSON object + */ + Cluster.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Cluster + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Cluster + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Cluster.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Cluster"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Cluster.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} REPAIRING=5 REPAIRING value + */ + Cluster.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "REPAIRING"] = 5; + return values; + })(); + + return Cluster; + })(); + + v1.ListClustersRequest = (function() { + + /** + * Properties of a ListClustersRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListClustersRequest + * @property {string|null} [parent] ListClustersRequest parent + * @property {number|null} [pageSize] ListClustersRequest pageSize + * @property {string|null} [pageToken] ListClustersRequest pageToken + * @property {string|null} [filter] ListClustersRequest filter + * @property {string|null} [orderBy] ListClustersRequest orderBy + */ + + /** + * Constructs a new ListClustersRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListClustersRequest. + * @implements IListClustersRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListClustersRequest=} [properties] Properties to set + */ + function ListClustersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListClustersRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.parent = ""; + + /** + * ListClustersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageSize = 0; + + /** + * ListClustersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.pageToken = ""; + + /** + * ListClustersRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.filter = ""; + + /** + * ListClustersRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + */ + ListClustersRequest.prototype.orderBy = ""; + + /** + * Creates a new ListClustersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListClustersRequest} ListClustersRequest instance + */ + ListClustersRequest.create = function create(properties) { + return new ListClustersRequest(properties); + }; + + /** + * Encodes the specified ListClustersRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.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 ListClustersRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersRequest} message ListClustersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decode = function 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.vmwareengine.v1.ListClustersRequest(); + 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 ListClustersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListClustersRequest} ListClustersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersRequest.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 ListClustersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListClustersRequest} ListClustersRequest + */ + ListClustersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListClustersRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListClustersRequest(); + 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 ListClustersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListClustersRequest} message ListClustersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersRequest.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 ListClustersRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @instance + * @returns {Object.} JSON object + */ + ListClustersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListClustersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListClustersRequest"; + }; + + return ListClustersRequest; + })(); + + v1.ListClustersResponse = (function() { + + /** + * Properties of a ListClustersResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListClustersResponse + * @property {Array.|null} [clusters] ListClustersResponse clusters + * @property {string|null} [nextPageToken] ListClustersResponse nextPageToken + * @property {Array.|null} [unreachable] ListClustersResponse unreachable + */ + + /** + * Constructs a new ListClustersResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListClustersResponse. + * @implements IListClustersResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListClustersResponse=} [properties] Properties to set + */ + function ListClustersResponse(properties) { + this.clusters = []; + 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]]; + } + + /** + * ListClustersResponse clusters. + * @member {Array.} clusters + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.clusters = $util.emptyArray; + + /** + * ListClustersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.nextPageToken = ""; + + /** + * ListClustersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @instance + */ + ListClustersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListClustersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListClustersResponse} ListClustersResponse instance + */ + ListClustersResponse.create = function create(properties) { + return new ListClustersResponse(properties); + }; + + /** + * Encodes the specified ListClustersResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.clusters != null && message.clusters.length) + for (var i = 0; i < message.clusters.length; ++i) + $root.google.cloud.vmwareengine.v1.Cluster.encode(message.clusters[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 ListClustersResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListClustersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListClustersResponse} message ListClustersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListClustersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListClustersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decode = function 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.vmwareengine.v1.ListClustersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.clusters && message.clusters.length)) + message.clusters = []; + message.clusters.push($root.google.cloud.vmwareengine.v1.Cluster.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 ListClustersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListClustersResponse} ListClustersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListClustersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListClustersResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListClustersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.clusters != null && message.hasOwnProperty("clusters")) { + if (!Array.isArray(message.clusters)) + return "clusters: array expected"; + for (var i = 0; i < message.clusters.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.Cluster.verify(message.clusters[i]); + if (error) + return "clusters." + 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 ListClustersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListClustersResponse} ListClustersResponse + */ + ListClustersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListClustersResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListClustersResponse(); + if (object.clusters) { + if (!Array.isArray(object.clusters)) + throw TypeError(".google.cloud.vmwareengine.v1.ListClustersResponse.clusters: array expected"); + message.clusters = []; + for (var i = 0; i < object.clusters.length; ++i) { + if (typeof object.clusters[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListClustersResponse.clusters: object expected"); + message.clusters[i] = $root.google.cloud.vmwareengine.v1.Cluster.fromObject(object.clusters[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListClustersResponse.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 ListClustersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListClustersResponse} message ListClustersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListClustersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.clusters = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.clusters && message.clusters.length) { + object.clusters = []; + for (var j = 0; j < message.clusters.length; ++j) + object.clusters[j] = $root.google.cloud.vmwareengine.v1.Cluster.toObject(message.clusters[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 ListClustersResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @instance + * @returns {Object.} JSON object + */ + ListClustersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListClustersResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListClustersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListClustersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListClustersResponse"; + }; + + return ListClustersResponse; + })(); + + v1.GetClusterRequest = (function() { + + /** + * Properties of a GetClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetClusterRequest + * @property {string|null} [name] GetClusterRequest name + */ + + /** + * Constructs a new GetClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetClusterRequest. + * @implements IGetClusterRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest=} [properties] Properties to set + */ + function GetClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetClusterRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @instance + */ + GetClusterRequest.prototype.name = ""; + + /** + * Creates a new GetClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetClusterRequest} GetClusterRequest instance + */ + GetClusterRequest.create = function create(properties) { + return new GetClusterRequest(properties); + }; + + /** + * Encodes the specified GetClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.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 GetClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetClusterRequest} message GetClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decode = function 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.vmwareengine.v1.GetClusterRequest(); + 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 GetClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetClusterRequest} GetClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetClusterRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetClusterRequest.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 GetClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetClusterRequest} GetClusterRequest + */ + GetClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetClusterRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetClusterRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetClusterRequest} message GetClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetClusterRequest.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 GetClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @instance + * @returns {Object.} JSON object + */ + GetClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetClusterRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetClusterRequest"; + }; + + return GetClusterRequest; + })(); + + v1.CreateClusterRequest = (function() { + + /** + * Properties of a CreateClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICreateClusterRequest + * @property {string|null} [parent] CreateClusterRequest parent + * @property {string|null} [clusterId] CreateClusterRequest clusterId + * @property {google.cloud.vmwareengine.v1.ICluster|null} [cluster] CreateClusterRequest cluster + * @property {string|null} [requestId] CreateClusterRequest requestId + * @property {boolean|null} [validateOnly] CreateClusterRequest validateOnly + */ + + /** + * Constructs a new CreateClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a CreateClusterRequest. + * @implements ICreateClusterRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest=} [properties] Properties to set + */ + function CreateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateClusterRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.parent = ""; + + /** + * CreateClusterRequest clusterId. + * @member {string} clusterId + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.clusterId = ""; + + /** + * CreateClusterRequest cluster. + * @member {google.cloud.vmwareengine.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.cluster = null; + + /** + * CreateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.requestId = ""; + + /** + * CreateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + */ + CreateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateClusterRequest} CreateClusterRequest instance + */ + CreateClusterRequest.create = function create(properties) { + return new CreateClusterRequest(properties); + }; + + /** + * Encodes the specified CreateClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.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.clusterId != null && Object.hasOwnProperty.call(message, "clusterId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.clusterId); + if (message.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.vmwareengine.v1.Cluster.encode(message.cluster, 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); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateClusterRequest} message CreateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decode = function 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.vmwareengine.v1.CreateClusterRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.clusterId = reader.string(); + break; + } + case 3: { + message.cluster = $root.google.cloud.vmwareengine.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreateClusterRequest} CreateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateClusterRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateClusterRequest.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.clusterId != null && message.hasOwnProperty("clusterId")) + if (!$util.isString(message.clusterId)) + return "clusterId: string expected"; + if (message.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.vmwareengine.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreateClusterRequest} CreateClusterRequest + */ + CreateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateClusterRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreateClusterRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.clusterId != null) + message.clusterId = String(object.clusterId); + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.vmwareengine.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreateClusterRequest} message CreateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.clusterId = ""; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.clusterId != null && message.hasOwnProperty("clusterId")) + object.clusterId = message.clusterId; + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.vmwareengine.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + CreateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateClusterRequest"; + }; + + return CreateClusterRequest; + })(); + + v1.UpdateClusterRequest = (function() { + + /** + * Properties of an UpdateClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUpdateClusterRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateClusterRequest updateMask + * @property {google.cloud.vmwareengine.v1.ICluster|null} [cluster] UpdateClusterRequest cluster + * @property {string|null} [requestId] UpdateClusterRequest requestId + * @property {boolean|null} [validateOnly] UpdateClusterRequest validateOnly + */ + + /** + * Constructs a new UpdateClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UpdateClusterRequest. + * @implements IUpdateClusterRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest=} [properties] Properties to set + */ + function UpdateClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateClusterRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.updateMask = null; + + /** + * UpdateClusterRequest cluster. + * @member {google.cloud.vmwareengine.v1.ICluster|null|undefined} cluster + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.cluster = null; + + /** + * UpdateClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.requestId = ""; + + /** + * UpdateClusterRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @instance + */ + UpdateClusterRequest.prototype.validateOnly = false; + + /** + * Creates a new UpdateClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateClusterRequest} UpdateClusterRequest instance + */ + UpdateClusterRequest.create = function create(properties) { + return new UpdateClusterRequest(properties); + }; + + /** + * Encodes the specified UpdateClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.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.cluster != null && Object.hasOwnProperty.call(message, "cluster")) + $root.google.cloud.vmwareengine.v1.Cluster.encode(message.cluster, 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); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified UpdateClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateClusterRequest} message UpdateClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decode = function 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.vmwareengine.v1.UpdateClusterRequest(); + 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.cluster = $root.google.cloud.vmwareengine.v1.Cluster.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UpdateClusterRequest} UpdateClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateClusterRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateClusterRequest.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.cluster != null && message.hasOwnProperty("cluster")) { + var error = $root.google.cloud.vmwareengine.v1.Cluster.verify(message.cluster); + if (error) + return "cluster." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates an UpdateClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UpdateClusterRequest} UpdateClusterRequest + */ + UpdateClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateClusterRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UpdateClusterRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateClusterRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.cluster != null) { + if (typeof object.cluster !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateClusterRequest.cluster: object expected"); + message.cluster = $root.google.cloud.vmwareengine.v1.Cluster.fromObject(object.cluster); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from an UpdateClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.UpdateClusterRequest} message UpdateClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateClusterRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.cluster = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.cluster != null && message.hasOwnProperty("cluster")) + object.cluster = $root.google.cloud.vmwareengine.v1.Cluster.toObject(message.cluster, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this UpdateClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateClusterRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UpdateClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateClusterRequest"; + }; + + return UpdateClusterRequest; + })(); + + v1.DeleteClusterRequest = (function() { + + /** + * Properties of a DeleteClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IDeleteClusterRequest + * @property {string|null} [name] DeleteClusterRequest name + * @property {string|null} [requestId] DeleteClusterRequest requestId + */ + + /** + * Constructs a new DeleteClusterRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a DeleteClusterRequest. + * @implements IDeleteClusterRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest=} [properties] Properties to set + */ + function DeleteClusterRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteClusterRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.name = ""; + + /** + * DeleteClusterRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @instance + */ + DeleteClusterRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteClusterRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeleteClusterRequest} DeleteClusterRequest instance + */ + DeleteClusterRequest.create = function create(properties) { + return new DeleteClusterRequest(properties); + }; + + /** + * Encodes the specified DeleteClusterRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteClusterRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.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 DeleteClusterRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteClusterRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteClusterRequest} message DeleteClusterRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteClusterRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteClusterRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decode = function 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.vmwareengine.v1.DeleteClusterRequest(); + 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 DeleteClusterRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.DeleteClusterRequest} DeleteClusterRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteClusterRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteClusterRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteClusterRequest.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 DeleteClusterRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.DeleteClusterRequest} DeleteClusterRequest + */ + DeleteClusterRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteClusterRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.DeleteClusterRequest(); + 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 DeleteClusterRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {google.cloud.vmwareengine.v1.DeleteClusterRequest} message DeleteClusterRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteClusterRequest.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 DeleteClusterRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteClusterRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteClusterRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.DeleteClusterRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteClusterRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteClusterRequest"; + }; + + return DeleteClusterRequest; + })(); + + v1.Subnet = (function() { + + /** + * Properties of a Subnet. + * @memberof google.cloud.vmwareengine.v1 + * @interface ISubnet + * @property {string|null} [name] Subnet name + * @property {string|null} [ipCidrRange] Subnet ipCidrRange + * @property {string|null} [gatewayIp] Subnet gatewayIp + * @property {string|null} [type] Subnet type + * @property {google.cloud.vmwareengine.v1.Subnet.State|null} [state] Subnet state + */ + + /** + * Constructs a new Subnet. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Subnet. + * @implements ISubnet + * @constructor + * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set + */ + function Subnet(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Subnet name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.name = ""; + + /** + * Subnet ipCidrRange. + * @member {string} ipCidrRange + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.ipCidrRange = ""; + + /** + * Subnet gatewayIp. + * @member {string} gatewayIp + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.gatewayIp = ""; + + /** + * Subnet type. + * @member {string} type + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.type = ""; + + /** + * Subnet state. + * @member {google.cloud.vmwareengine.v1.Subnet.State} state + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + */ + Subnet.prototype.state = 0; + + /** + * Creates a new Subnet instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet instance + */ + Subnet.create = function create(properties) { + return new Subnet(properties); + }; + + /** + * Encodes the specified Subnet message. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnet.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.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.ipCidrRange); + if (message.gatewayIp != null && Object.hasOwnProperty.call(message, "gatewayIp")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.gatewayIp); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.type); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Subnet message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Subnet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.ISubnet} message Subnet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Subnet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Subnet message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnet.decode = function 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.vmwareengine.v1.Subnet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 7: { + message.ipCidrRange = reader.string(); + break; + } + case 8: { + message.gatewayIp = reader.string(); + break; + } + case 11: { + message.type = reader.string(); + break; + } + case 13: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Subnet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Subnet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Subnet message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Subnet.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.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) + if (!$util.isString(message.gatewayIp)) + return "gatewayIp: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: 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; + } + return null; + }; + + /** + * Creates a Subnet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Subnet} Subnet + */ + Subnet.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Subnet) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Subnet(); + if (object.name != null) + message.name = String(object.name); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.gatewayIp != null) + message.gatewayIp = String(object.gatewayIp); + if (object.type != null) + message.type = String(object.type); + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a Subnet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {google.cloud.vmwareengine.v1.Subnet} message Subnet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Subnet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ipCidrRange = ""; + object.gatewayIp = ""; + object.type = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) + object.ipCidrRange = message.ipCidrRange; + if (message.gatewayIp != null && message.hasOwnProperty("gatewayIp")) + object.gatewayIp = message.gatewayIp; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Subnet.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Subnet to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Subnet + * @instance + * @returns {Object.} JSON object + */ + Subnet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Subnet + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Subnet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Subnet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Subnet"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Subnet.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + */ + Subnet.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Subnet; + })(); + + v1.ListSubnetsRequest = (function() { + + /** + * Properties of a ListSubnetsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListSubnetsRequest + * @property {string|null} [parent] ListSubnetsRequest parent + * @property {number|null} [pageSize] ListSubnetsRequest pageSize + * @property {string|null} [pageToken] ListSubnetsRequest pageToken + */ + + /** + * Constructs a new ListSubnetsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListSubnetsRequest. + * @implements IListSubnetsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest=} [properties] Properties to set + */ + function ListSubnetsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubnetsRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @instance + */ + ListSubnetsRequest.prototype.parent = ""; + + /** + * ListSubnetsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @instance + */ + ListSubnetsRequest.prototype.pageSize = 0; + + /** + * ListSubnetsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @instance + */ + ListSubnetsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSubnetsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListSubnetsRequest} ListSubnetsRequest instance + */ + ListSubnetsRequest.create = function create(properties) { + return new ListSubnetsRequest(properties); + }; + + /** + * Encodes the specified ListSubnetsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest} message ListSubnetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetsRequest.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); + return writer; + }; + + /** + * Encodes the specified ListSubnetsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsRequest} message ListSubnetsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubnetsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListSubnetsRequest} ListSubnetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetsRequest.decode = function 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.vmwareengine.v1.ListSubnetsRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubnetsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListSubnetsRequest} ListSubnetsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubnetsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubnetsRequest.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"; + return null; + }; + + /** + * Creates a ListSubnetsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListSubnetsRequest} ListSubnetsRequest + */ + ListSubnetsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListSubnetsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListSubnetsRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListSubnetsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListSubnetsRequest} message ListSubnetsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubnetsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListSubnetsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSubnetsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubnetsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListSubnetsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubnetsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListSubnetsRequest"; + }; + + return ListSubnetsRequest; + })(); + + v1.ListSubnetsResponse = (function() { + + /** + * Properties of a ListSubnetsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListSubnetsResponse + * @property {Array.|null} [subnets] ListSubnetsResponse subnets + * @property {string|null} [nextPageToken] ListSubnetsResponse nextPageToken + */ + + /** + * Constructs a new ListSubnetsResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListSubnetsResponse. + * @implements IListSubnetsResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListSubnetsResponse=} [properties] Properties to set + */ + function ListSubnetsResponse(properties) { + this.subnets = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSubnetsResponse subnets. + * @member {Array.} subnets + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @instance + */ + ListSubnetsResponse.prototype.subnets = $util.emptyArray; + + /** + * ListSubnetsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @instance + */ + ListSubnetsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSubnetsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListSubnetsResponse} ListSubnetsResponse instance + */ + ListSubnetsResponse.create = function create(properties) { + return new ListSubnetsResponse(properties); + }; + + /** + * Encodes the specified ListSubnetsResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsResponse} message ListSubnetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.subnets != null && message.subnets.length) + for (var i = 0; i < message.subnets.length; ++i) + $root.google.cloud.vmwareengine.v1.Subnet.encode(message.subnets[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 ListSubnetsResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListSubnetsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListSubnetsResponse} message ListSubnetsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSubnetsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSubnetsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListSubnetsResponse} ListSubnetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetsResponse.decode = function 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.vmwareengine.v1.ListSubnetsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.subnets && message.subnets.length)) + message.subnets = []; + message.subnets.push($root.google.cloud.vmwareengine.v1.Subnet.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSubnetsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListSubnetsResponse} ListSubnetsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSubnetsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSubnetsResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSubnetsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.subnets != null && message.hasOwnProperty("subnets")) { + if (!Array.isArray(message.subnets)) + return "subnets: array expected"; + for (var i = 0; i < message.subnets.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.Subnet.verify(message.subnets[i]); + if (error) + return "subnets." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSubnetsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListSubnetsResponse} ListSubnetsResponse + */ + ListSubnetsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListSubnetsResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListSubnetsResponse(); + if (object.subnets) { + if (!Array.isArray(object.subnets)) + throw TypeError(".google.cloud.vmwareengine.v1.ListSubnetsResponse.subnets: array expected"); + message.subnets = []; + for (var i = 0; i < object.subnets.length; ++i) { + if (typeof object.subnets[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListSubnetsResponse.subnets: object expected"); + message.subnets[i] = $root.google.cloud.vmwareengine.v1.Subnet.fromObject(object.subnets[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSubnetsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListSubnetsResponse} message ListSubnetsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSubnetsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.subnets = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.subnets && message.subnets.length) { + object.subnets = []; + for (var j = 0; j < message.subnets.length; ++j) + object.subnets[j] = $root.google.cloud.vmwareengine.v1.Subnet.toObject(message.subnets[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSubnetsResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSubnetsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSubnetsResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListSubnetsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSubnetsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListSubnetsResponse"; + }; + + return ListSubnetsResponse; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.vmwareengine.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.vmwareengine.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.vmwareengine.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.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @static + * @param {google.cloud.vmwareengine.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.vmwareengine.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @static + * @param {google.cloud.vmwareengine.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.vmwareengine.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.OperationMetadata + * @static + * @param {google.cloud.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.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.vmwareengine.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.vmwareengine.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.vmwareengine.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.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.vmwareengine.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.vmwareengine.v1.OperationMetadata + * @static + * @param {google.cloud.vmwareengine.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.vmwareengine.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.vmwareengine.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.vmwareengine.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.NodeType = (function() { + + /** + * Properties of a NodeType. + * @memberof google.cloud.vmwareengine.v1 + * @interface INodeType + * @property {string|null} [name] NodeType name + * @property {string|null} [nodeTypeId] NodeType nodeTypeId + * @property {string|null} [displayName] NodeType displayName + * @property {number|null} [virtualCpuCount] NodeType virtualCpuCount + * @property {number|null} [totalCoreCount] NodeType totalCoreCount + * @property {number|null} [memoryGb] NodeType memoryGb + * @property {number|null} [diskSizeGb] NodeType diskSizeGb + * @property {Array.|null} [availableCustomCoreCounts] NodeType availableCustomCoreCounts + */ + + /** + * Constructs a new NodeType. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NodeType. + * @implements INodeType + * @constructor + * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set + */ + function NodeType(properties) { + this.availableCustomCoreCounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NodeType name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.name = ""; + + /** + * NodeType nodeTypeId. + * @member {string} nodeTypeId + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.nodeTypeId = ""; + + /** + * NodeType displayName. + * @member {string} displayName + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.displayName = ""; + + /** + * NodeType virtualCpuCount. + * @member {number} virtualCpuCount + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.virtualCpuCount = 0; + + /** + * NodeType totalCoreCount. + * @member {number} totalCoreCount + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.totalCoreCount = 0; + + /** + * NodeType memoryGb. + * @member {number} memoryGb + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.memoryGb = 0; + + /** + * NodeType diskSizeGb. + * @member {number} diskSizeGb + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.diskSizeGb = 0; + + /** + * NodeType availableCustomCoreCounts. + * @member {Array.} availableCustomCoreCounts + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + */ + NodeType.prototype.availableCustomCoreCounts = $util.emptyArray; + + /** + * Creates a new NodeType instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType instance + */ + NodeType.create = function create(properties) { + return new NodeType(properties); + }; + + /** + * Encodes the specified NodeType message. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.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.nodeTypeId != null && Object.hasOwnProperty.call(message, "nodeTypeId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeTypeId); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayName); + if (message.virtualCpuCount != null && Object.hasOwnProperty.call(message, "virtualCpuCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.virtualCpuCount); + if (message.totalCoreCount != null && Object.hasOwnProperty.call(message, "totalCoreCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.totalCoreCount); + if (message.memoryGb != null && Object.hasOwnProperty.call(message, "memoryGb")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.memoryGb); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.diskSizeGb); + if (message.availableCustomCoreCounts != null && message.availableCustomCoreCounts.length) { + writer.uint32(/* id 11, wireType 2 =*/90).fork(); + for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) + writer.int32(message.availableCustomCoreCounts[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified NodeType message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NodeType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.INodeType} message NodeType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decode = function 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.vmwareengine.v1.NodeType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.nodeTypeId = reader.string(); + break; + } + case 3: { + message.displayName = reader.string(); + break; + } + case 4: { + message.virtualCpuCount = reader.int32(); + break; + } + case 5: { + message.totalCoreCount = reader.int32(); + break; + } + case 7: { + message.memoryGb = reader.int32(); + break; + } + case 8: { + message.diskSizeGb = reader.int32(); + break; + } + case 11: { + if (!(message.availableCustomCoreCounts && message.availableCustomCoreCounts.length)) + message.availableCustomCoreCounts = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.availableCustomCoreCounts.push(reader.int32()); + } else + message.availableCustomCoreCounts.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NodeType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeType message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeType.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.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) + if (!$util.isString(message.nodeTypeId)) + return "nodeTypeId: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) + if (!$util.isInteger(message.virtualCpuCount)) + return "virtualCpuCount: integer expected"; + if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) + if (!$util.isInteger(message.totalCoreCount)) + return "totalCoreCount: integer expected"; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + if (!$util.isInteger(message.memoryGb)) + return "memoryGb: integer expected"; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + if (!$util.isInteger(message.diskSizeGb)) + return "diskSizeGb: integer expected"; + if (message.availableCustomCoreCounts != null && message.hasOwnProperty("availableCustomCoreCounts")) { + if (!Array.isArray(message.availableCustomCoreCounts)) + return "availableCustomCoreCounts: array expected"; + for (var i = 0; i < message.availableCustomCoreCounts.length; ++i) + if (!$util.isInteger(message.availableCustomCoreCounts[i])) + return "availableCustomCoreCounts: integer[] expected"; + } + return null; + }; + + /** + * Creates a NodeType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NodeType} NodeType + */ + NodeType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NodeType) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NodeType(); + if (object.name != null) + message.name = String(object.name); + if (object.nodeTypeId != null) + message.nodeTypeId = String(object.nodeTypeId); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.virtualCpuCount != null) + message.virtualCpuCount = object.virtualCpuCount | 0; + if (object.totalCoreCount != null) + message.totalCoreCount = object.totalCoreCount | 0; + if (object.memoryGb != null) + message.memoryGb = object.memoryGb | 0; + if (object.diskSizeGb != null) + message.diskSizeGb = object.diskSizeGb | 0; + if (object.availableCustomCoreCounts) { + if (!Array.isArray(object.availableCustomCoreCounts)) + throw TypeError(".google.cloud.vmwareengine.v1.NodeType.availableCustomCoreCounts: array expected"); + message.availableCustomCoreCounts = []; + for (var i = 0; i < object.availableCustomCoreCounts.length; ++i) + message.availableCustomCoreCounts[i] = object.availableCustomCoreCounts[i] | 0; + } + return message; + }; + + /** + * Creates a plain object from a NodeType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {google.cloud.vmwareengine.v1.NodeType} message NodeType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableCustomCoreCounts = []; + if (options.defaults) { + object.name = ""; + object.nodeTypeId = ""; + object.displayName = ""; + object.virtualCpuCount = 0; + object.totalCoreCount = 0; + object.memoryGb = 0; + object.diskSizeGb = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.nodeTypeId != null && message.hasOwnProperty("nodeTypeId")) + object.nodeTypeId = message.nodeTypeId; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.virtualCpuCount != null && message.hasOwnProperty("virtualCpuCount")) + object.virtualCpuCount = message.virtualCpuCount; + if (message.totalCoreCount != null && message.hasOwnProperty("totalCoreCount")) + object.totalCoreCount = message.totalCoreCount; + if (message.memoryGb != null && message.hasOwnProperty("memoryGb")) + object.memoryGb = message.memoryGb; + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) + object.diskSizeGb = message.diskSizeGb; + if (message.availableCustomCoreCounts && message.availableCustomCoreCounts.length) { + object.availableCustomCoreCounts = []; + for (var j = 0; j < message.availableCustomCoreCounts.length; ++j) + object.availableCustomCoreCounts[j] = message.availableCustomCoreCounts[j]; + } + return object; + }; + + /** + * Converts this NodeType to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NodeType + * @instance + * @returns {Object.} JSON object + */ + NodeType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeType + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NodeType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NodeType"; + }; + + return NodeType; + })(); + + v1.ListNodeTypesRequest = (function() { + + /** + * Properties of a ListNodeTypesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListNodeTypesRequest + * @property {string|null} [parent] ListNodeTypesRequest parent + * @property {number|null} [pageSize] ListNodeTypesRequest pageSize + * @property {string|null} [pageToken] ListNodeTypesRequest pageToken + * @property {string|null} [filter] ListNodeTypesRequest filter + */ + + /** + * Constructs a new ListNodeTypesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListNodeTypesRequest. + * @implements IListNodeTypesRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set + */ + function ListNodeTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNodeTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.parent = ""; + + /** + * ListNodeTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.pageSize = 0; + + /** + * ListNodeTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.pageToken = ""; + + /** + * ListNodeTypesRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + */ + ListNodeTypesRequest.prototype.filter = ""; + + /** + * Creates a new ListNodeTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest instance + */ + ListNodeTypesRequest.create = function create(properties) { + return new ListNodeTypesRequest(properties); + }; + + /** + * Encodes the specified ListNodeTypesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesRequest.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); + return writer; + }; + + /** + * Encodes the specified ListNodeTypesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesRequest} message ListNodeTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesRequest.decode = function 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.vmwareengine.v1.ListNodeTypesRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNodeTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodeTypesRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodeTypesRequest.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"; + return null; + }; + + /** + * Creates a ListNodeTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesRequest} ListNodeTypesRequest + */ + ListNodeTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListNodeTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListNodeTypesRequest} message ListNodeTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodeTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + 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; + return object; + }; + + /** + * Converts this ListNodeTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListNodeTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNodeTypesRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNodeTypesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesRequest"; + }; + + return ListNodeTypesRequest; + })(); + + v1.ListNodeTypesResponse = (function() { + + /** + * Properties of a ListNodeTypesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListNodeTypesResponse + * @property {Array.|null} [nodeTypes] ListNodeTypesResponse nodeTypes + * @property {string|null} [nextPageToken] ListNodeTypesResponse nextPageToken + * @property {Array.|null} [unreachable] ListNodeTypesResponse unreachable + */ + + /** + * Constructs a new ListNodeTypesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListNodeTypesResponse. + * @implements IListNodeTypesResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set + */ + function ListNodeTypesResponse(properties) { + this.nodeTypes = []; + 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]]; + } + + /** + * ListNodeTypesResponse nodeTypes. + * @member {Array.} nodeTypes + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + */ + ListNodeTypesResponse.prototype.nodeTypes = $util.emptyArray; + + /** + * ListNodeTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + */ + ListNodeTypesResponse.prototype.nextPageToken = ""; + + /** + * ListNodeTypesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + */ + ListNodeTypesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListNodeTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse instance + */ + ListNodeTypesResponse.create = function create(properties) { + return new ListNodeTypesResponse(properties); + }; + + /** + * Encodes the specified ListNodeTypesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nodeTypes != null && message.nodeTypes.length) + for (var i = 0; i < message.nodeTypes.length; ++i) + $root.google.cloud.vmwareengine.v1.NodeType.encode(message.nodeTypes[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 ListNodeTypesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNodeTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNodeTypesResponse} message ListNodeTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNodeTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNodeTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesResponse.decode = function 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.vmwareengine.v1.ListNodeTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.nodeTypes && message.nodeTypes.length)) + message.nodeTypes = []; + message.nodeTypes.push($root.google.cloud.vmwareengine.v1.NodeType.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 ListNodeTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNodeTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNodeTypesResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNodeTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.nodeTypes != null && message.hasOwnProperty("nodeTypes")) { + if (!Array.isArray(message.nodeTypes)) + return "nodeTypes: array expected"; + for (var i = 0; i < message.nodeTypes.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NodeType.verify(message.nodeTypes[i]); + if (error) + return "nodeTypes." + 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 ListNodeTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListNodeTypesResponse} ListNodeTypesResponse + */ + ListNodeTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListNodeTypesResponse(); + if (object.nodeTypes) { + if (!Array.isArray(object.nodeTypes)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: array expected"); + message.nodeTypes = []; + for (var i = 0; i < object.nodeTypes.length; ++i) { + if (typeof object.nodeTypes[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.nodeTypes: object expected"); + message.nodeTypes[i] = $root.google.cloud.vmwareengine.v1.NodeType.fromObject(object.nodeTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNodeTypesResponse.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 ListNodeTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListNodeTypesResponse} message ListNodeTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNodeTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.nodeTypes = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.nodeTypes && message.nodeTypes.length) { + object.nodeTypes = []; + for (var j = 0; j < message.nodeTypes.length; ++j) + object.nodeTypes[j] = $root.google.cloud.vmwareengine.v1.NodeType.toObject(message.nodeTypes[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 ListNodeTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListNodeTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNodeTypesResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListNodeTypesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNodeTypesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNodeTypesResponse"; + }; + + return ListNodeTypesResponse; + })(); + + v1.GetNodeTypeRequest = (function() { + + /** + * Properties of a GetNodeTypeRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetNodeTypeRequest + * @property {string|null} [name] GetNodeTypeRequest name + */ + + /** + * Constructs a new GetNodeTypeRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetNodeTypeRequest. + * @implements IGetNodeTypeRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set + */ + function GetNodeTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNodeTypeRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @instance + */ + GetNodeTypeRequest.prototype.name = ""; + + /** + * Creates a new GetNodeTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest instance + */ + GetNodeTypeRequest.create = function create(properties) { + return new GetNodeTypeRequest(properties); + }; + + /** + * Encodes the specified GetNodeTypeRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTypeRequest.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 GetNodeTypeRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNodeTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNodeTypeRequest} message GetNodeTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNodeTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNodeTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTypeRequest.decode = function 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.vmwareengine.v1.GetNodeTypeRequest(); + 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 GetNodeTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNodeTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNodeTypeRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNodeTypeRequest.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 GetNodeTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetNodeTypeRequest} GetNodeTypeRequest + */ + GetNodeTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetNodeTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNodeTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetNodeTypeRequest} message GetNodeTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNodeTypeRequest.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 GetNodeTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetNodeTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNodeTypeRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetNodeTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNodeTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNodeTypeRequest"; + }; + + return GetNodeTypeRequest; + })(); + + v1.Credentials = (function() { + + /** + * Properties of a Credentials. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICredentials + * @property {string|null} [username] Credentials username + * @property {string|null} [password] Credentials password + */ + + /** + * Constructs a new Credentials. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Credentials. + * @implements ICredentials + * @constructor + * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set + */ + function Credentials(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Credentials username. + * @member {string} username + * @memberof google.cloud.vmwareengine.v1.Credentials + * @instance + */ + Credentials.prototype.username = ""; + + /** + * Credentials password. + * @member {string} password + * @memberof google.cloud.vmwareengine.v1.Credentials + * @instance + */ + Credentials.prototype.password = ""; + + /** + * Creates a new Credentials instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {google.cloud.vmwareengine.v1.ICredentials=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials instance + */ + Credentials.create = function create(properties) { + return new Credentials(properties); + }; + + /** + * Encodes the specified Credentials message. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Credentials.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); + return writer; + }; + + /** + * Encodes the specified Credentials message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Credentials.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {google.cloud.vmwareengine.v1.ICredentials} message Credentials message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Credentials.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Credentials message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Credentials.decode = function 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.vmwareengine.v1.Credentials(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Credentials message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Credentials.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Credentials message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Credentials.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"; + return null; + }; + + /** + * Creates a Credentials message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Credentials} Credentials + */ + Credentials.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Credentials) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Credentials(); + if (object.username != null) + message.username = String(object.username); + if (object.password != null) + message.password = String(object.password); + return message; + }; + + /** + * Creates a plain object from a Credentials message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {google.cloud.vmwareengine.v1.Credentials} message Credentials + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Credentials.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.username = ""; + object.password = ""; + } + if (message.username != null && message.hasOwnProperty("username")) + object.username = message.username; + if (message.password != null && message.hasOwnProperty("password")) + object.password = message.password; + return object; + }; + + /** + * Converts this Credentials to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Credentials + * @instance + * @returns {Object.} JSON object + */ + Credentials.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Credentials + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Credentials + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Credentials.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Credentials"; + }; + + return Credentials; + })(); + + v1.ShowNsxCredentialsRequest = (function() { + + /** + * Properties of a ShowNsxCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IShowNsxCredentialsRequest + * @property {string|null} [privateCloud] ShowNsxCredentialsRequest privateCloud + */ + + /** + * Constructs a new ShowNsxCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ShowNsxCredentialsRequest. + * @implements IShowNsxCredentialsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set + */ + function ShowNsxCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShowNsxCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @instance + */ + ShowNsxCredentialsRequest.prototype.privateCloud = ""; + + /** + * Creates a new ShowNsxCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest instance + */ + ShowNsxCredentialsRequest.create = function create(properties) { + return new ShowNsxCredentialsRequest(properties); + }; + + /** + * Encodes the specified ShowNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowNsxCredentialsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + return writer; + }; + + /** + * Encodes the specified ShowNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest} message ShowNsxCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowNsxCredentialsRequest.decode = function 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.vmwareengine.v1.ShowNsxCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateCloud = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShowNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShowNsxCredentialsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShowNsxCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + return null; + }; + + /** + * Creates a ShowNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} ShowNsxCredentialsRequest + */ + ShowNsxCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + return message; + }; + + /** + * Creates a plain object from a ShowNsxCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest} message ShowNsxCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShowNsxCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.privateCloud = ""; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + return object; + }; + + /** + * Converts this ShowNsxCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + ShowNsxCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShowNsxCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShowNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest"; + }; + + return ShowNsxCredentialsRequest; + })(); + + v1.ShowVcenterCredentialsRequest = (function() { + + /** + * Properties of a ShowVcenterCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IShowVcenterCredentialsRequest + * @property {string|null} [privateCloud] ShowVcenterCredentialsRequest privateCloud + */ + + /** + * Constructs a new ShowVcenterCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ShowVcenterCredentialsRequest. + * @implements IShowVcenterCredentialsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set + */ + function ShowVcenterCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ShowVcenterCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @instance + */ + ShowVcenterCredentialsRequest.prototype.privateCloud = ""; + + /** + * Creates a new ShowVcenterCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest instance + */ + ShowVcenterCredentialsRequest.create = function create(properties) { + return new ShowVcenterCredentialsRequest(properties); + }; + + /** + * Encodes the specified ShowVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowVcenterCredentialsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + return writer; + }; + + /** + * Encodes the specified ShowVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ShowVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowVcenterCredentialsRequest.decode = function 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.vmwareengine.v1.ShowVcenterCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateCloud = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ShowVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ShowVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ShowVcenterCredentialsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ShowVcenterCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + return null; + }; + + /** + * Creates a ShowVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} ShowVcenterCredentialsRequest + */ + ShowVcenterCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + return message; + }; + + /** + * Creates a plain object from a ShowVcenterCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest} message ShowVcenterCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ShowVcenterCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.privateCloud = ""; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + return object; + }; + + /** + * Converts this ShowVcenterCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + ShowVcenterCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ShowVcenterCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ShowVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest"; + }; + + return ShowVcenterCredentialsRequest; + })(); + + v1.ResetNsxCredentialsRequest = (function() { + + /** + * Properties of a ResetNsxCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IResetNsxCredentialsRequest + * @property {string|null} [privateCloud] ResetNsxCredentialsRequest privateCloud + * @property {string|null} [requestId] ResetNsxCredentialsRequest requestId + */ + + /** + * Constructs a new ResetNsxCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ResetNsxCredentialsRequest. + * @implements IResetNsxCredentialsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set + */ + function ResetNsxCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResetNsxCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @instance + */ + ResetNsxCredentialsRequest.prototype.privateCloud = ""; + + /** + * ResetNsxCredentialsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @instance + */ + ResetNsxCredentialsRequest.prototype.requestId = ""; + + /** + * Creates a new ResetNsxCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest instance + */ + ResetNsxCredentialsRequest.create = function create(properties) { + return new ResetNsxCredentialsRequest(properties); + }; + + /** + * Encodes the specified ResetNsxCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetNsxCredentialsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResetNsxCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest} message ResetNsxCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetNsxCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetNsxCredentialsRequest.decode = function 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.vmwareengine.v1.ResetNsxCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateCloud = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResetNsxCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetNsxCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResetNsxCredentialsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResetNsxCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResetNsxCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} ResetNsxCredentialsRequest + */ + ResetNsxCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResetNsxCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest} message ResetNsxCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResetNsxCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateCloud = ""; + object.requestId = ""; + } + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResetNsxCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + ResetNsxCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResetNsxCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResetNsxCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest"; + }; + + return ResetNsxCredentialsRequest; + })(); + + v1.ResetVcenterCredentialsRequest = (function() { + + /** + * Properties of a ResetVcenterCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IResetVcenterCredentialsRequest + * @property {string|null} [privateCloud] ResetVcenterCredentialsRequest privateCloud + * @property {string|null} [requestId] ResetVcenterCredentialsRequest requestId + */ + + /** + * Constructs a new ResetVcenterCredentialsRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ResetVcenterCredentialsRequest. + * @implements IResetVcenterCredentialsRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set + */ + function ResetVcenterCredentialsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResetVcenterCredentialsRequest privateCloud. + * @member {string} privateCloud + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @instance + */ + ResetVcenterCredentialsRequest.prototype.privateCloud = ""; + + /** + * ResetVcenterCredentialsRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @instance + */ + ResetVcenterCredentialsRequest.prototype.requestId = ""; + + /** + * Creates a new ResetVcenterCredentialsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest instance + */ + ResetVcenterCredentialsRequest.create = function create(properties) { + return new ResetVcenterCredentialsRequest(properties); + }; + + /** + * Encodes the specified ResetVcenterCredentialsRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetVcenterCredentialsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.privateCloud != null && Object.hasOwnProperty.call(message, "privateCloud")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.privateCloud); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified ResetVcenterCredentialsRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResetVcenterCredentialsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetVcenterCredentialsRequest.decode = function 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.vmwareengine.v1.ResetVcenterCredentialsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.privateCloud = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResetVcenterCredentialsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResetVcenterCredentialsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResetVcenterCredentialsRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResetVcenterCredentialsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + if (!$util.isString(message.privateCloud)) + return "privateCloud: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a ResetVcenterCredentialsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} ResetVcenterCredentialsRequest + */ + ResetVcenterCredentialsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest(); + if (object.privateCloud != null) + message.privateCloud = String(object.privateCloud); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a ResetVcenterCredentialsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest} message ResetVcenterCredentialsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResetVcenterCredentialsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.privateCloud = ""; + object.requestId = ""; + } + if (message.privateCloud != null && message.hasOwnProperty("privateCloud")) + object.privateCloud = message.privateCloud; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this ResetVcenterCredentialsRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @instance + * @returns {Object.} JSON object + */ + ResetVcenterCredentialsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResetVcenterCredentialsRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResetVcenterCredentialsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest"; + }; + + return ResetVcenterCredentialsRequest; + })(); + + v1.ListHcxActivationKeysResponse = (function() { + + /** + * Properties of a ListHcxActivationKeysResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListHcxActivationKeysResponse + * @property {Array.|null} [hcxActivationKeys] ListHcxActivationKeysResponse hcxActivationKeys + * @property {string|null} [nextPageToken] ListHcxActivationKeysResponse nextPageToken + * @property {Array.|null} [unreachable] ListHcxActivationKeysResponse unreachable + */ + + /** + * Constructs a new ListHcxActivationKeysResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListHcxActivationKeysResponse. + * @implements IListHcxActivationKeysResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set + */ + function ListHcxActivationKeysResponse(properties) { + this.hcxActivationKeys = []; + 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]]; + } + + /** + * ListHcxActivationKeysResponse hcxActivationKeys. + * @member {Array.} hcxActivationKeys + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + */ + ListHcxActivationKeysResponse.prototype.hcxActivationKeys = $util.emptyArray; + + /** + * ListHcxActivationKeysResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + */ + ListHcxActivationKeysResponse.prototype.nextPageToken = ""; + + /** + * ListHcxActivationKeysResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + */ + ListHcxActivationKeysResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListHcxActivationKeysResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse instance + */ + ListHcxActivationKeysResponse.create = function create(properties) { + return new ListHcxActivationKeysResponse(properties); + }; + + /** + * Encodes the specified ListHcxActivationKeysResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHcxActivationKeysResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hcxActivationKeys != null && message.hcxActivationKeys.length) + for (var i = 0; i < message.hcxActivationKeys.length; ++i) + $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKeys[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 ListHcxActivationKeysResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse} message ListHcxActivationKeysResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHcxActivationKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHcxActivationKeysResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHcxActivationKeysResponse.decode = function 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.vmwareengine.v1.ListHcxActivationKeysResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.hcxActivationKeys && message.hcxActivationKeys.length)) + message.hcxActivationKeys = []; + message.hcxActivationKeys.push($root.google.cloud.vmwareengine.v1.HcxActivationKey.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 ListHcxActivationKeysResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHcxActivationKeysResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHcxActivationKeysResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHcxActivationKeysResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hcxActivationKeys != null && message.hasOwnProperty("hcxActivationKeys")) { + if (!Array.isArray(message.hcxActivationKeys)) + return "hcxActivationKeys: array expected"; + for (var i = 0; i < message.hcxActivationKeys.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKeys[i]); + if (error) + return "hcxActivationKeys." + 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 ListHcxActivationKeysResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} ListHcxActivationKeysResponse + */ + ListHcxActivationKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse(); + if (object.hcxActivationKeys) { + if (!Array.isArray(object.hcxActivationKeys)) + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: array expected"); + message.hcxActivationKeys = []; + for (var i = 0; i < object.hcxActivationKeys.length; ++i) { + if (typeof object.hcxActivationKeys[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.hcxActivationKeys: object expected"); + message.hcxActivationKeys[i] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKeys[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse.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 ListHcxActivationKeysResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse} message ListHcxActivationKeysResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHcxActivationKeysResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.hcxActivationKeys = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.hcxActivationKeys && message.hcxActivationKeys.length) { + object.hcxActivationKeys = []; + for (var j = 0; j < message.hcxActivationKeys.length; ++j) + object.hcxActivationKeys[j] = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKeys[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 ListHcxActivationKeysResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @instance + * @returns {Object.} JSON object + */ + ListHcxActivationKeysResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHcxActivationKeysResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHcxActivationKeysResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse"; + }; + + return ListHcxActivationKeysResponse; + })(); + + v1.HcxActivationKey = (function() { + + /** + * Properties of a HcxActivationKey. + * @memberof google.cloud.vmwareengine.v1 + * @interface IHcxActivationKey + * @property {string|null} [name] HcxActivationKey name + * @property {google.protobuf.ITimestamp|null} [createTime] HcxActivationKey createTime + * @property {google.cloud.vmwareengine.v1.HcxActivationKey.State|null} [state] HcxActivationKey state + * @property {string|null} [activationKey] HcxActivationKey activationKey + * @property {string|null} [uid] HcxActivationKey uid + */ + + /** + * Constructs a new HcxActivationKey. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a HcxActivationKey. + * @implements IHcxActivationKey + * @constructor + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set + */ + function HcxActivationKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HcxActivationKey name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + */ + HcxActivationKey.prototype.name = ""; + + /** + * HcxActivationKey createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + */ + HcxActivationKey.prototype.createTime = null; + + /** + * HcxActivationKey state. + * @member {google.cloud.vmwareengine.v1.HcxActivationKey.State} state + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + */ + HcxActivationKey.prototype.state = 0; + + /** + * HcxActivationKey activationKey. + * @member {string} activationKey + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + */ + HcxActivationKey.prototype.activationKey = ""; + + /** + * HcxActivationKey uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + */ + HcxActivationKey.prototype.uid = ""; + + /** + * Creates a new HcxActivationKey instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey instance + */ + HcxActivationKey.create = function create(properties) { + return new HcxActivationKey(properties); + }; + + /** + * Encodes the specified HcxActivationKey message. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HcxActivationKey.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.activationKey != null && Object.hasOwnProperty.call(message, "activationKey")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.activationKey); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.uid); + return writer; + }; + + /** + * Encodes the specified HcxActivationKey message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.HcxActivationKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {google.cloud.vmwareengine.v1.IHcxActivationKey} message HcxActivationKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HcxActivationKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HcxActivationKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HcxActivationKey.decode = function 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.vmwareengine.v1.HcxActivationKey(); + 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.state = reader.int32(); + break; + } + case 4: { + message.activationKey = reader.string(); + break; + } + case 5: { + message.uid = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HcxActivationKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HcxActivationKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HcxActivationKey message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HcxActivationKey.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.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.activationKey != null && message.hasOwnProperty("activationKey")) + if (!$util.isString(message.activationKey)) + return "activationKey: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + return null; + }; + + /** + * Creates a HcxActivationKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.HcxActivationKey} HcxActivationKey + */ + HcxActivationKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.HcxActivationKey) + return object; + var message = new $root.google.cloud.vmwareengine.v1.HcxActivationKey(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.HcxActivationKey.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + 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 "AVAILABLE": + case 1: + message.state = 1; + break; + case "CONSUMED": + case 2: + message.state = 2; + break; + case "CREATING": + case 3: + message.state = 3; + break; + } + if (object.activationKey != null) + message.activationKey = String(object.activationKey); + if (object.uid != null) + message.uid = String(object.uid); + return message; + }; + + /** + * Creates a plain object from a HcxActivationKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {google.cloud.vmwareengine.v1.HcxActivationKey} message HcxActivationKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HcxActivationKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.activationKey = ""; + object.uid = ""; + } + 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.HcxActivationKey.State[message.state] : message.state; + if (message.activationKey != null && message.hasOwnProperty("activationKey")) + object.activationKey = message.activationKey; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + return object; + }; + + /** + * Converts this HcxActivationKey to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @instance + * @returns {Object.} JSON object + */ + HcxActivationKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HcxActivationKey + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.HcxActivationKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HcxActivationKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.HcxActivationKey"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.HcxActivationKey.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} AVAILABLE=1 AVAILABLE value + * @property {number} CONSUMED=2 CONSUMED value + * @property {number} CREATING=3 CREATING value + */ + HcxActivationKey.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AVAILABLE"] = 1; + values[valuesById[2] = "CONSUMED"] = 2; + values[valuesById[3] = "CREATING"] = 3; + return values; + })(); + + return HcxActivationKey; + })(); + + v1.ListHcxActivationKeysRequest = (function() { + + /** + * Properties of a ListHcxActivationKeysRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListHcxActivationKeysRequest + * @property {string|null} [parent] ListHcxActivationKeysRequest parent + * @property {number|null} [pageSize] ListHcxActivationKeysRequest pageSize + * @property {string|null} [pageToken] ListHcxActivationKeysRequest pageToken + */ + + /** + * Constructs a new ListHcxActivationKeysRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListHcxActivationKeysRequest. + * @implements IListHcxActivationKeysRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set + */ + function ListHcxActivationKeysRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListHcxActivationKeysRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @instance + */ + ListHcxActivationKeysRequest.prototype.parent = ""; + + /** + * ListHcxActivationKeysRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @instance + */ + ListHcxActivationKeysRequest.prototype.pageSize = 0; + + /** + * ListHcxActivationKeysRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @instance + */ + ListHcxActivationKeysRequest.prototype.pageToken = ""; + + /** + * Creates a new ListHcxActivationKeysRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest instance + */ + ListHcxActivationKeysRequest.create = function create(properties) { + return new ListHcxActivationKeysRequest(properties); + }; + + /** + * Encodes the specified ListHcxActivationKeysRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHcxActivationKeysRequest.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); + return writer; + }; + + /** + * Encodes the specified ListHcxActivationKeysRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest} message ListHcxActivationKeysRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListHcxActivationKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHcxActivationKeysRequest.decode = function 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.vmwareengine.v1.ListHcxActivationKeysRequest(); + 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; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListHcxActivationKeysRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListHcxActivationKeysRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListHcxActivationKeysRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListHcxActivationKeysRequest.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"; + return null; + }; + + /** + * Creates a ListHcxActivationKeysRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} ListHcxActivationKeysRequest + */ + ListHcxActivationKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest(); + 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); + return message; + }; + + /** + * Creates a plain object from a ListHcxActivationKeysRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest} message ListHcxActivationKeysRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListHcxActivationKeysRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + 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; + return object; + }; + + /** + * Converts this ListHcxActivationKeysRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @instance + * @returns {Object.} JSON object + */ + ListHcxActivationKeysRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListHcxActivationKeysRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListHcxActivationKeysRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest"; + }; + + return ListHcxActivationKeysRequest; + })(); + + v1.GetHcxActivationKeyRequest = (function() { + + /** + * Properties of a GetHcxActivationKeyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetHcxActivationKeyRequest + * @property {string|null} [name] GetHcxActivationKeyRequest name + */ + + /** + * Constructs a new GetHcxActivationKeyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetHcxActivationKeyRequest. + * @implements IGetHcxActivationKeyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set + */ + function GetHcxActivationKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetHcxActivationKeyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @instance + */ + GetHcxActivationKeyRequest.prototype.name = ""; + + /** + * Creates a new GetHcxActivationKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest instance + */ + GetHcxActivationKeyRequest.create = function create(properties) { + return new GetHcxActivationKeyRequest(properties); + }; + + /** + * Encodes the specified GetHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHcxActivationKeyRequest.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 GetHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest} message GetHcxActivationKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetHcxActivationKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHcxActivationKeyRequest.decode = function 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.vmwareengine.v1.GetHcxActivationKeyRequest(); + 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 GetHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetHcxActivationKeyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetHcxActivationKeyRequest.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 GetHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} GetHcxActivationKeyRequest + */ + GetHcxActivationKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetHcxActivationKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest} message GetHcxActivationKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetHcxActivationKeyRequest.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 GetHcxActivationKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @instance + * @returns {Object.} JSON object + */ + GetHcxActivationKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetHcxActivationKeyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest"; + }; + + return GetHcxActivationKeyRequest; + })(); + + v1.CreateHcxActivationKeyRequest = (function() { + + /** + * Properties of a CreateHcxActivationKeyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICreateHcxActivationKeyRequest + * @property {string|null} [parent] CreateHcxActivationKeyRequest parent + * @property {google.cloud.vmwareengine.v1.IHcxActivationKey|null} [hcxActivationKey] CreateHcxActivationKeyRequest hcxActivationKey + * @property {string|null} [hcxActivationKeyId] CreateHcxActivationKeyRequest hcxActivationKeyId + * @property {string|null} [requestId] CreateHcxActivationKeyRequest requestId + */ + + /** + * Constructs a new CreateHcxActivationKeyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a CreateHcxActivationKeyRequest. + * @implements ICreateHcxActivationKeyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set + */ + function CreateHcxActivationKeyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateHcxActivationKeyRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + */ + CreateHcxActivationKeyRequest.prototype.parent = ""; + + /** + * CreateHcxActivationKeyRequest hcxActivationKey. + * @member {google.cloud.vmwareengine.v1.IHcxActivationKey|null|undefined} hcxActivationKey + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + */ + CreateHcxActivationKeyRequest.prototype.hcxActivationKey = null; + + /** + * CreateHcxActivationKeyRequest hcxActivationKeyId. + * @member {string} hcxActivationKeyId + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + */ + CreateHcxActivationKeyRequest.prototype.hcxActivationKeyId = ""; + + /** + * CreateHcxActivationKeyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + */ + CreateHcxActivationKeyRequest.prototype.requestId = ""; + + /** + * Creates a new CreateHcxActivationKeyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest instance + */ + CreateHcxActivationKeyRequest.create = function create(properties) { + return new CreateHcxActivationKeyRequest(properties); + }; + + /** + * Encodes the specified CreateHcxActivationKeyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHcxActivationKeyRequest.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.hcxActivationKey != null && Object.hasOwnProperty.call(message, "hcxActivationKey")) + $root.google.cloud.vmwareengine.v1.HcxActivationKey.encode(message.hcxActivationKey, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.hcxActivationKeyId != null && Object.hasOwnProperty.call(message, "hcxActivationKeyId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.hcxActivationKeyId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateHcxActivationKeyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateHcxActivationKeyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHcxActivationKeyRequest.decode = function 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.vmwareengine.v1.CreateHcxActivationKeyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.decode(reader, reader.uint32()); + break; + } + case 3: { + message.hcxActivationKeyId = reader.string(); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateHcxActivationKeyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateHcxActivationKeyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateHcxActivationKeyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateHcxActivationKeyRequest.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.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) { + var error = $root.google.cloud.vmwareengine.v1.HcxActivationKey.verify(message.hcxActivationKey); + if (error) + return "hcxActivationKey." + error; + } + if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) + if (!$util.isString(message.hcxActivationKeyId)) + return "hcxActivationKeyId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateHcxActivationKeyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} CreateHcxActivationKeyRequest + */ + CreateHcxActivationKeyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.hcxActivationKey != null) { + if (typeof object.hcxActivationKey !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest.hcxActivationKey: object expected"); + message.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.fromObject(object.hcxActivationKey); + } + if (object.hcxActivationKeyId != null) + message.hcxActivationKeyId = String(object.hcxActivationKeyId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateHcxActivationKeyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest} message CreateHcxActivationKeyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateHcxActivationKeyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.hcxActivationKey = null; + object.hcxActivationKeyId = ""; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.hcxActivationKey != null && message.hasOwnProperty("hcxActivationKey")) + object.hcxActivationKey = $root.google.cloud.vmwareengine.v1.HcxActivationKey.toObject(message.hcxActivationKey, options); + if (message.hcxActivationKeyId != null && message.hasOwnProperty("hcxActivationKeyId")) + object.hcxActivationKeyId = message.hcxActivationKeyId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateHcxActivationKeyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateHcxActivationKeyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateHcxActivationKeyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateHcxActivationKeyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest"; + }; + + return CreateHcxActivationKeyRequest; + })(); + + v1.Hcx = (function() { + + /** + * Properties of a Hcx. + * @memberof google.cloud.vmwareengine.v1 + * @interface IHcx + * @property {string|null} [internalIp] Hcx internalIp + * @property {string|null} [version] Hcx version + * @property {google.cloud.vmwareengine.v1.Hcx.State|null} [state] Hcx state + * @property {string|null} [fqdn] Hcx fqdn + */ + + /** + * Constructs a new Hcx. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Hcx. + * @implements IHcx + * @constructor + * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set + */ + function Hcx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Hcx internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Hcx + * @instance + */ + Hcx.prototype.internalIp = ""; + + /** + * Hcx version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Hcx + * @instance + */ + Hcx.prototype.version = ""; + + /** + * Hcx state. + * @member {google.cloud.vmwareengine.v1.Hcx.State} state + * @memberof google.cloud.vmwareengine.v1.Hcx + * @instance + */ + Hcx.prototype.state = 0; + + /** + * Hcx fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Hcx + * @instance + */ + Hcx.prototype.fqdn = ""; + + /** + * Creates a new Hcx instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {google.cloud.vmwareengine.v1.IHcx=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx instance + */ + Hcx.create = function create(properties) { + return new Hcx(properties); + }; + + /** + * Encodes the specified Hcx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hcx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); + return writer; + }; + + /** + * Encodes the specified Hcx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Hcx.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {google.cloud.vmwareengine.v1.IHcx} message Hcx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Hcx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Hcx message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hcx.decode = function 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.vmwareengine.v1.Hcx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.internalIp = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.fqdn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Hcx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Hcx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Hcx message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Hcx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string 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: + break; + } + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; + return null; + }; + + /** + * Creates a Hcx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Hcx} Hcx + */ + Hcx.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Hcx) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Hcx(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.fqdn != null) + message.fqdn = String(object.fqdn); + return message; + }; + + /** + * Creates a plain object from a Hcx message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {google.cloud.vmwareengine.v1.Hcx} message Hcx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Hcx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.internalIp = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.fqdn = ""; + } + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + 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.vmwareengine.v1.Hcx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Hcx.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; + return object; + }; + + /** + * Converts this Hcx to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Hcx + * @instance + * @returns {Object.} JSON object + */ + Hcx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Hcx + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Hcx + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Hcx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Hcx"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Hcx.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + */ + Hcx.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Hcx; + })(); + + v1.Nsx = (function() { + + /** + * Properties of a Nsx. + * @memberof google.cloud.vmwareengine.v1 + * @interface INsx + * @property {string|null} [internalIp] Nsx internalIp + * @property {string|null} [version] Nsx version + * @property {google.cloud.vmwareengine.v1.Nsx.State|null} [state] Nsx state + * @property {string|null} [fqdn] Nsx fqdn + */ + + /** + * Constructs a new Nsx. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Nsx. + * @implements INsx + * @constructor + * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set + */ + function Nsx(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Nsx internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.internalIp = ""; + + /** + * Nsx version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.version = ""; + + /** + * Nsx state. + * @member {google.cloud.vmwareengine.v1.Nsx.State} state + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.state = 0; + + /** + * Nsx fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + */ + Nsx.prototype.fqdn = ""; + + /** + * Creates a new Nsx instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {google.cloud.vmwareengine.v1.INsx=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx instance + */ + Nsx.create = function create(properties) { + return new Nsx(properties); + }; + + /** + * Encodes the specified Nsx message. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Nsx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); + return writer; + }; + + /** + * Encodes the specified Nsx message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Nsx.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {google.cloud.vmwareengine.v1.INsx} message Nsx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Nsx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Nsx message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Nsx.decode = function 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.vmwareengine.v1.Nsx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.internalIp = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.fqdn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Nsx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Nsx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Nsx message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Nsx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string 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: + break; + } + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; + return null; + }; + + /** + * Creates a Nsx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Nsx} Nsx + */ + Nsx.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Nsx) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Nsx(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.fqdn != null) + message.fqdn = String(object.fqdn); + return message; + }; + + /** + * Creates a plain object from a Nsx message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {google.cloud.vmwareengine.v1.Nsx} message Nsx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Nsx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.internalIp = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.fqdn = ""; + } + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + 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.vmwareengine.v1.Nsx.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Nsx.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; + return object; + }; + + /** + * Converts this Nsx to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Nsx + * @instance + * @returns {Object.} JSON object + */ + Nsx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Nsx + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Nsx + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Nsx.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Nsx"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Nsx.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + */ + Nsx.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Nsx; + })(); + + v1.Vcenter = (function() { + + /** + * Properties of a Vcenter. + * @memberof google.cloud.vmwareengine.v1 + * @interface IVcenter + * @property {string|null} [internalIp] Vcenter internalIp + * @property {string|null} [version] Vcenter version + * @property {google.cloud.vmwareengine.v1.Vcenter.State|null} [state] Vcenter state + * @property {string|null} [fqdn] Vcenter fqdn + */ + + /** + * Constructs a new Vcenter. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a Vcenter. + * @implements IVcenter + * @constructor + * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set + */ + function Vcenter(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Vcenter internalIp. + * @member {string} internalIp + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @instance + */ + Vcenter.prototype.internalIp = ""; + + /** + * Vcenter version. + * @member {string} version + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @instance + */ + Vcenter.prototype.version = ""; + + /** + * Vcenter state. + * @member {google.cloud.vmwareengine.v1.Vcenter.State} state + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @instance + */ + Vcenter.prototype.state = 0; + + /** + * Vcenter fqdn. + * @member {string} fqdn + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @instance + */ + Vcenter.prototype.fqdn = ""; + + /** + * Creates a new Vcenter instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {google.cloud.vmwareengine.v1.IVcenter=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter instance + */ + Vcenter.create = function create(properties) { + return new Vcenter(properties); + }; + + /** + * Encodes the specified Vcenter message. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vcenter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.internalIp != null && Object.hasOwnProperty.call(message, "internalIp")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.internalIp); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.version); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.fqdn != null && Object.hasOwnProperty.call(message, "fqdn")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fqdn); + return writer; + }; + + /** + * Encodes the specified Vcenter message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.Vcenter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {google.cloud.vmwareengine.v1.IVcenter} message Vcenter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Vcenter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Vcenter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vcenter.decode = function 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.vmwareengine.v1.Vcenter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: { + message.internalIp = reader.string(); + break; + } + case 4: { + message.version = reader.string(); + break; + } + case 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.fqdn = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Vcenter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Vcenter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Vcenter message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Vcenter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + if (!$util.isString(message.internalIp)) + return "internalIp: string 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: + break; + } + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + if (!$util.isString(message.fqdn)) + return "fqdn: string expected"; + return null; + }; + + /** + * Creates a Vcenter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.Vcenter} Vcenter + */ + Vcenter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.Vcenter) + return object; + var message = new $root.google.cloud.vmwareengine.v1.Vcenter(); + if (object.internalIp != null) + message.internalIp = String(object.internalIp); + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "CREATING": + case 2: + message.state = 2; + break; + } + if (object.fqdn != null) + message.fqdn = String(object.fqdn); + return message; + }; + + /** + * Creates a plain object from a Vcenter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {google.cloud.vmwareengine.v1.Vcenter} message Vcenter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Vcenter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.internalIp = ""; + object.version = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.fqdn = ""; + } + if (message.internalIp != null && message.hasOwnProperty("internalIp")) + object.internalIp = message.internalIp; + 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.vmwareengine.v1.Vcenter.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.Vcenter.State[message.state] : message.state; + if (message.fqdn != null && message.hasOwnProperty("fqdn")) + object.fqdn = message.fqdn; + return object; + }; + + /** + * Converts this Vcenter to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @instance + * @returns {Object.} JSON object + */ + Vcenter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Vcenter + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.Vcenter + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Vcenter.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.Vcenter"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.Vcenter.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} CREATING=2 CREATING value + */ + Vcenter.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "CREATING"] = 2; + return values; + })(); + + return Vcenter; + })(); + + v1.NetworkPolicy = (function() { + + /** + * Properties of a NetworkPolicy. + * @memberof google.cloud.vmwareengine.v1 + * @interface INetworkPolicy + * @property {string|null} [name] NetworkPolicy name + * @property {google.protobuf.ITimestamp|null} [createTime] NetworkPolicy createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] NetworkPolicy updateTime + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [internetAccess] NetworkPolicy internetAccess + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null} [externalIp] NetworkPolicy externalIp + * @property {string|null} [edgeServicesCidr] NetworkPolicy edgeServicesCidr + * @property {string|null} [uid] NetworkPolicy uid + * @property {string|null} [vmwareEngineNetwork] NetworkPolicy vmwareEngineNetwork + * @property {string|null} [description] NetworkPolicy description + * @property {string|null} [vmwareEngineNetworkCanonical] NetworkPolicy vmwareEngineNetworkCanonical + */ + + /** + * Constructs a new NetworkPolicy. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a NetworkPolicy. + * @implements INetworkPolicy + * @constructor + * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set + */ + function NetworkPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPolicy name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.name = ""; + + /** + * NetworkPolicy createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.createTime = null; + + /** + * NetworkPolicy updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.updateTime = null; + + /** + * NetworkPolicy internetAccess. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} internetAccess + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.internetAccess = null; + + /** + * NetworkPolicy externalIp. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService|null|undefined} externalIp + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.externalIp = null; + + /** + * NetworkPolicy edgeServicesCidr. + * @member {string} edgeServicesCidr + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.edgeServicesCidr = ""; + + /** + * NetworkPolicy uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.uid = ""; + + /** + * NetworkPolicy vmwareEngineNetwork. + * @member {string} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.vmwareEngineNetwork = ""; + + /** + * NetworkPolicy description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.description = ""; + + /** + * NetworkPolicy vmwareEngineNetworkCanonical. + * @member {string} vmwareEngineNetworkCanonical + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + */ + NetworkPolicy.prototype.vmwareEngineNetworkCanonical = ""; + + /** + * Creates a new NetworkPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {google.cloud.vmwareengine.v1.INetworkPolicy=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy instance + */ + NetworkPolicy.create = function create(properties) { + return new NetworkPolicy(properties); + }; + + /** + * Encodes the specified NetworkPolicy message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.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.internetAccess != null && Object.hasOwnProperty.call(message, "internetAccess")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.internetAccess, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.encode(message.externalIp, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.edgeServicesCidr != null && Object.hasOwnProperty.call(message, "edgeServicesCidr")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.edgeServicesCidr); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.uid); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.vmwareEngineNetwork); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.description); + if (message.vmwareEngineNetworkCanonical != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkCanonical")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.vmwareEngineNetworkCanonical); + return writer; + }; + + /** + * Encodes the specified NetworkPolicy message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {google.cloud.vmwareengine.v1.INetworkPolicy} message NetworkPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decode = function 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.vmwareengine.v1.NetworkPolicy(); + 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 6: { + message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + break; + } + case 7: { + message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.decode(reader, reader.uint32()); + break; + } + case 9: { + message.edgeServicesCidr = reader.string(); + break; + } + case 10: { + message.uid = reader.string(); + break; + } + case 12: { + message.vmwareEngineNetwork = reader.string(); + break; + } + case 13: { + message.description = reader.string(); + break; + } + case 14: { + message.vmwareEngineNetworkCanonical = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPolicy message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPolicy.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.internetAccess != null && message.hasOwnProperty("internetAccess")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.internetAccess); + if (error) + return "internetAccess." + error; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify(message.externalIp); + if (error) + return "externalIp." + error; + } + if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) + if (!$util.isString(message.edgeServicesCidr)) + return "edgeServicesCidr: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + if (!$util.isString(message.vmwareEngineNetwork)) + return "vmwareEngineNetwork: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + if (!$util.isString(message.vmwareEngineNetworkCanonical)) + return "vmwareEngineNetworkCanonical: string expected"; + return null; + }; + + /** + * Creates a NetworkPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy} NetworkPolicy + */ + NetworkPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.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.vmwareengine.v1.NetworkPolicy.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.internetAccess != null) { + if (typeof object.internetAccess !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.internetAccess: object expected"); + message.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.internetAccess); + } + if (object.externalIp != null) { + if (typeof object.externalIp !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.NetworkPolicy.externalIp: object expected"); + message.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.fromObject(object.externalIp); + } + if (object.edgeServicesCidr != null) + message.edgeServicesCidr = String(object.edgeServicesCidr); + if (object.uid != null) + message.uid = String(object.uid); + if (object.vmwareEngineNetwork != null) + message.vmwareEngineNetwork = String(object.vmwareEngineNetwork); + if (object.description != null) + message.description = String(object.description); + if (object.vmwareEngineNetworkCanonical != null) + message.vmwareEngineNetworkCanonical = String(object.vmwareEngineNetworkCanonical); + return message; + }; + + /** + * Creates a plain object from a NetworkPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy} message NetworkPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.internetAccess = null; + object.externalIp = null; + object.edgeServicesCidr = ""; + object.uid = ""; + object.vmwareEngineNetwork = ""; + object.description = ""; + object.vmwareEngineNetworkCanonical = ""; + } + 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.internetAccess != null && message.hasOwnProperty("internetAccess")) + object.internetAccess = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.internetAccess, options); + if (message.externalIp != null && message.hasOwnProperty("externalIp")) + object.externalIp = $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.toObject(message.externalIp, options); + if (message.edgeServicesCidr != null && message.hasOwnProperty("edgeServicesCidr")) + object.edgeServicesCidr = message.edgeServicesCidr; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = message.vmwareEngineNetwork; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.vmwareEngineNetworkCanonical != null && message.hasOwnProperty("vmwareEngineNetworkCanonical")) + object.vmwareEngineNetworkCanonical = message.vmwareEngineNetworkCanonical; + return object; + }; + + /** + * Converts this NetworkPolicy to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @instance + * @returns {Object.} JSON object + */ + NetworkPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPolicy + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy"; + }; + + NetworkPolicy.NetworkService = (function() { + + /** + * Properties of a NetworkService. + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @interface INetworkService + * @property {boolean|null} [enabled] NetworkService enabled + * @property {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State|null} [state] NetworkService state + */ + + /** + * Constructs a new NetworkService. + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy + * @classdesc Represents a NetworkService. + * @implements INetworkService + * @constructor + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set + */ + function NetworkService(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkService enabled. + * @member {boolean} enabled + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + */ + NetworkService.prototype.enabled = false; + + /** + * NetworkService state. + * @member {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State} state + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + */ + NetworkService.prototype.state = 0; + + /** + * Creates a new NetworkService instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService instance + */ + NetworkService.create = function create(properties) { + return new NetworkService(properties); + }; + + /** + * Encodes the specified NetworkService message. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkService.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enabled != null && Object.hasOwnProperty.call(message, "enabled")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enabled); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified NetworkService message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.INetworkService} message NetworkService message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkService.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkService message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkService.decode = function 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.vmwareengine.v1.NetworkPolicy.NetworkService(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.enabled = reader.bool(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkService message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkService.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkService message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkService.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enabled != null && message.hasOwnProperty("enabled")) + if (typeof message.enabled !== "boolean") + return "enabled: boolean 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; + } + return null; + }; + + /** + * Creates a NetworkService message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} NetworkService + */ + NetworkService.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService) + return object; + var message = new $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService(); + if (object.enabled != null) + message.enabled = Boolean(object.enabled); + 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 "UNPROVISIONED": + case 1: + message.state = 1; + break; + case "RECONCILING": + case 2: + message.state = 2; + break; + case "ACTIVE": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkService message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService} message NetworkService + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkService.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enabled = false; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.enabled != null && message.hasOwnProperty("enabled")) + object.enabled = message.enabled; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State[message.state] : message.state; + return object; + }; + + /** + * Converts this NetworkService to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @instance + * @returns {Object.} JSON object + */ + NetworkService.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkService + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkService.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService"; + }; + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} UNPROVISIONED=1 UNPROVISIONED value + * @property {number} RECONCILING=2 RECONCILING value + * @property {number} ACTIVE=3 ACTIVE value + */ + NetworkService.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "UNPROVISIONED"] = 1; + values[valuesById[2] = "RECONCILING"] = 2; + values[valuesById[3] = "ACTIVE"] = 3; + return values; + })(); + + return NetworkService; + })(); + + return NetworkPolicy; + })(); + + v1.ListNetworkPoliciesRequest = (function() { + + /** + * Properties of a ListNetworkPoliciesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListNetworkPoliciesRequest + * @property {string|null} [parent] ListNetworkPoliciesRequest parent + * @property {number|null} [pageSize] ListNetworkPoliciesRequest pageSize + * @property {string|null} [pageToken] ListNetworkPoliciesRequest pageToken + * @property {string|null} [filter] ListNetworkPoliciesRequest filter + * @property {string|null} [orderBy] ListNetworkPoliciesRequest orderBy + */ + + /** + * Constructs a new ListNetworkPoliciesRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListNetworkPoliciesRequest. + * @implements IListNetworkPoliciesRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set + */ + function ListNetworkPoliciesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNetworkPoliciesRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.parent = ""; + + /** + * ListNetworkPoliciesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.pageSize = 0; + + /** + * ListNetworkPoliciesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.pageToken = ""; + + /** + * ListNetworkPoliciesRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.filter = ""; + + /** + * ListNetworkPoliciesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + */ + ListNetworkPoliciesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListNetworkPoliciesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest instance + */ + ListNetworkPoliciesRequest.create = function create(properties) { + return new ListNetworkPoliciesRequest(properties); + }; + + /** + * Encodes the specified ListNetworkPoliciesRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkPoliciesRequest.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 ListNetworkPoliciesRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest} message ListNetworkPoliciesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkPoliciesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworkPoliciesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkPoliciesRequest.decode = function 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.vmwareengine.v1.ListNetworkPoliciesRequest(); + 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 ListNetworkPoliciesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkPoliciesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworkPoliciesRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworkPoliciesRequest.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 ListNetworkPoliciesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} ListNetworkPoliciesRequest + */ + ListNetworkPoliciesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest(); + 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 ListNetworkPoliciesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest} message ListNetworkPoliciesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworkPoliciesRequest.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 ListNetworkPoliciesRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @instance + * @returns {Object.} JSON object + */ + ListNetworkPoliciesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNetworkPoliciesRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNetworkPoliciesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest"; + }; + + return ListNetworkPoliciesRequest; + })(); + + v1.ListNetworkPoliciesResponse = (function() { + + /** + * Properties of a ListNetworkPoliciesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListNetworkPoliciesResponse + * @property {Array.|null} [networkPolicies] ListNetworkPoliciesResponse networkPolicies + * @property {string|null} [nextPageToken] ListNetworkPoliciesResponse nextPageToken + * @property {Array.|null} [unreachable] ListNetworkPoliciesResponse unreachable + */ + + /** + * Constructs a new ListNetworkPoliciesResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListNetworkPoliciesResponse. + * @implements IListNetworkPoliciesResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set + */ + function ListNetworkPoliciesResponse(properties) { + this.networkPolicies = []; + 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]]; + } + + /** + * ListNetworkPoliciesResponse networkPolicies. + * @member {Array.} networkPolicies + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @instance + */ + ListNetworkPoliciesResponse.prototype.networkPolicies = $util.emptyArray; + + /** + * ListNetworkPoliciesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @instance + */ + ListNetworkPoliciesResponse.prototype.nextPageToken = ""; + + /** + * ListNetworkPoliciesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @instance + */ + ListNetworkPoliciesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListNetworkPoliciesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse instance + */ + ListNetworkPoliciesResponse.create = function create(properties) { + return new ListNetworkPoliciesResponse(properties); + }; + + /** + * Encodes the specified ListNetworkPoliciesResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkPoliciesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkPolicies != null && message.networkPolicies.length) + for (var i = 0; i < message.networkPolicies.length; ++i) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicies[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 ListNetworkPoliciesResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse} message ListNetworkPoliciesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNetworkPoliciesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNetworkPoliciesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkPoliciesResponse.decode = function 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.vmwareengine.v1.ListNetworkPoliciesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.networkPolicies && message.networkPolicies.length)) + message.networkPolicies = []; + message.networkPolicies.push($root.google.cloud.vmwareengine.v1.NetworkPolicy.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 ListNetworkPoliciesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNetworkPoliciesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNetworkPoliciesResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNetworkPoliciesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkPolicies != null && message.hasOwnProperty("networkPolicies")) { + if (!Array.isArray(message.networkPolicies)) + return "networkPolicies: array expected"; + for (var i = 0; i < message.networkPolicies.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicies[i]); + if (error) + return "networkPolicies." + 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 ListNetworkPoliciesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} ListNetworkPoliciesResponse + */ + ListNetworkPoliciesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse(); + if (object.networkPolicies) { + if (!Array.isArray(object.networkPolicies)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: array expected"); + message.networkPolicies = []; + for (var i = 0; i < object.networkPolicies.length; ++i) { + if (typeof object.networkPolicies[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.networkPolicies: object expected"); + message.networkPolicies[i] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicies[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse.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 ListNetworkPoliciesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse} message ListNetworkPoliciesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNetworkPoliciesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkPolicies = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.networkPolicies && message.networkPolicies.length) { + object.networkPolicies = []; + for (var j = 0; j < message.networkPolicies.length; ++j) + object.networkPolicies[j] = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicies[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 ListNetworkPoliciesResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @instance + * @returns {Object.} JSON object + */ + ListNetworkPoliciesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListNetworkPoliciesResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNetworkPoliciesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse"; + }; + + return ListNetworkPoliciesResponse; + })(); + + v1.GetNetworkPolicyRequest = (function() { + + /** + * Properties of a GetNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetNetworkPolicyRequest + * @property {string|null} [name] GetNetworkPolicyRequest name + */ + + /** + * Constructs a new GetNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetNetworkPolicyRequest. + * @implements IGetNetworkPolicyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set + */ + function GetNetworkPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetNetworkPolicyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @instance + */ + GetNetworkPolicyRequest.prototype.name = ""; + + /** + * Creates a new GetNetworkPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest instance + */ + GetNetworkPolicyRequest.create = function create(properties) { + return new GetNetworkPolicyRequest(properties); + }; + + /** + * Encodes the specified GetNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkPolicyRequest.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 GetNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetNetworkPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest} message GetNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetNetworkPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkPolicyRequest.decode = function 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.vmwareengine.v1.GetNetworkPolicyRequest(); + 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 GetNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetNetworkPolicyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetNetworkPolicyRequest.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 GetNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} GetNetworkPolicyRequest + */ + GetNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetNetworkPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetNetworkPolicyRequest} message GetNetworkPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetNetworkPolicyRequest.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 GetNetworkPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + GetNetworkPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetNetworkPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetNetworkPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetNetworkPolicyRequest"; + }; + + return GetNetworkPolicyRequest; + })(); + + v1.UpdateNetworkPolicyRequest = (function() { + + /** + * Properties of an UpdateNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUpdateNetworkPolicyRequest + * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] UpdateNetworkPolicyRequest networkPolicy + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateNetworkPolicyRequest updateMask + * @property {string|null} [requestId] UpdateNetworkPolicyRequest requestId + */ + + /** + * Constructs a new UpdateNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UpdateNetworkPolicyRequest. + * @implements IUpdateNetworkPolicyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set + */ + function UpdateNetworkPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateNetworkPolicyRequest networkPolicy. + * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @instance + */ + UpdateNetworkPolicyRequest.prototype.networkPolicy = null; + + /** + * UpdateNetworkPolicyRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @instance + */ + UpdateNetworkPolicyRequest.prototype.updateMask = null; + + /** + * UpdateNetworkPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @instance + */ + UpdateNetworkPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateNetworkPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest instance + */ + UpdateNetworkPolicyRequest.create = function create(properties) { + return new UpdateNetworkPolicyRequest(properties); + }; + + /** + * Encodes the specified UpdateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNetworkPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNetworkPolicyRequest.decode = function 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.vmwareengine.v1.UpdateNetworkPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateNetworkPolicyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateNetworkPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); + if (error) + return "networkPolicy." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} UpdateNetworkPolicyRequest + */ + UpdateNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest(); + if (object.networkPolicy != null) { + if (typeof object.networkPolicy !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.networkPolicy: object expected"); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateNetworkPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest} message UpdateNetworkPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateNetworkPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkPolicy = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) + object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateNetworkPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateNetworkPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateNetworkPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest"; + }; + + return UpdateNetworkPolicyRequest; + })(); + + v1.CreateNetworkPolicyRequest = (function() { + + /** + * Properties of a CreateNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICreateNetworkPolicyRequest + * @property {string|null} [parent] CreateNetworkPolicyRequest parent + * @property {string|null} [networkPolicyId] CreateNetworkPolicyRequest networkPolicyId + * @property {google.cloud.vmwareengine.v1.INetworkPolicy|null} [networkPolicy] CreateNetworkPolicyRequest networkPolicy + * @property {string|null} [requestId] CreateNetworkPolicyRequest requestId + */ + + /** + * Constructs a new CreateNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a CreateNetworkPolicyRequest. + * @implements ICreateNetworkPolicyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set + */ + function CreateNetworkPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateNetworkPolicyRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @instance + */ + CreateNetworkPolicyRequest.prototype.parent = ""; + + /** + * CreateNetworkPolicyRequest networkPolicyId. + * @member {string} networkPolicyId + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @instance + */ + CreateNetworkPolicyRequest.prototype.networkPolicyId = ""; + + /** + * CreateNetworkPolicyRequest networkPolicy. + * @member {google.cloud.vmwareengine.v1.INetworkPolicy|null|undefined} networkPolicy + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @instance + */ + CreateNetworkPolicyRequest.prototype.networkPolicy = null; + + /** + * CreateNetworkPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @instance + */ + CreateNetworkPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new CreateNetworkPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest instance + */ + CreateNetworkPolicyRequest.create = function create(properties) { + return new CreateNetworkPolicyRequest(properties); + }; + + /** + * Encodes the specified CreateNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNetworkPolicyRequest.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.networkPolicyId != null && Object.hasOwnProperty.call(message, "networkPolicyId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.networkPolicyId); + if (message.networkPolicy != null && Object.hasOwnProperty.call(message, "networkPolicy")) + $root.google.cloud.vmwareengine.v1.NetworkPolicy.encode(message.networkPolicy, 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 CreateNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest} message CreateNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNetworkPolicyRequest.decode = function 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.vmwareengine.v1.CreateNetworkPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.networkPolicyId = reader.string(); + break; + } + case 3: { + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateNetworkPolicyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateNetworkPolicyRequest.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.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) + if (!$util.isString(message.networkPolicyId)) + return "networkPolicyId: string expected"; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) { + var error = $root.google.cloud.vmwareengine.v1.NetworkPolicy.verify(message.networkPolicy); + if (error) + return "networkPolicy." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} CreateNetworkPolicyRequest + */ + CreateNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.networkPolicyId != null) + message.networkPolicyId = String(object.networkPolicyId); + if (object.networkPolicy != null) { + if (typeof object.networkPolicy !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest.networkPolicy: object expected"); + message.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.fromObject(object.networkPolicy); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateNetworkPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest} message CreateNetworkPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateNetworkPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.networkPolicyId = ""; + object.networkPolicy = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.networkPolicyId != null && message.hasOwnProperty("networkPolicyId")) + object.networkPolicyId = message.networkPolicyId; + if (message.networkPolicy != null && message.hasOwnProperty("networkPolicy")) + object.networkPolicy = $root.google.cloud.vmwareengine.v1.NetworkPolicy.toObject(message.networkPolicy, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateNetworkPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + CreateNetworkPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateNetworkPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest"; + }; + + return CreateNetworkPolicyRequest; + })(); + + v1.DeleteNetworkPolicyRequest = (function() { + + /** + * Properties of a DeleteNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IDeleteNetworkPolicyRequest + * @property {string|null} [name] DeleteNetworkPolicyRequest name + * @property {string|null} [requestId] DeleteNetworkPolicyRequest requestId + */ + + /** + * Constructs a new DeleteNetworkPolicyRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a DeleteNetworkPolicyRequest. + * @implements IDeleteNetworkPolicyRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set + */ + function DeleteNetworkPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteNetworkPolicyRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @instance + */ + DeleteNetworkPolicyRequest.prototype.name = ""; + + /** + * DeleteNetworkPolicyRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @instance + */ + DeleteNetworkPolicyRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteNetworkPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest instance + */ + DeleteNetworkPolicyRequest.create = function create(properties) { + return new DeleteNetworkPolicyRequest(properties); + }; + + /** + * Encodes the specified DeleteNetworkPolicyRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkPolicyRequest.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 DeleteNetworkPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteNetworkPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteNetworkPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkPolicyRequest.decode = function 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.vmwareengine.v1.DeleteNetworkPolicyRequest(); + 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 DeleteNetworkPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteNetworkPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteNetworkPolicyRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteNetworkPolicyRequest.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 DeleteNetworkPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} DeleteNetworkPolicyRequest + */ + DeleteNetworkPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest(); + 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 DeleteNetworkPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest} message DeleteNetworkPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteNetworkPolicyRequest.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 DeleteNetworkPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteNetworkPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteNetworkPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteNetworkPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest"; + }; + + return DeleteNetworkPolicyRequest; + })(); + + v1.VmwareEngineNetwork = (function() { + + /** + * Properties of a VmwareEngineNetwork. + * @memberof google.cloud.vmwareengine.v1 + * @interface IVmwareEngineNetwork + * @property {string|null} [name] VmwareEngineNetwork name + * @property {google.protobuf.ITimestamp|null} [createTime] VmwareEngineNetwork createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] VmwareEngineNetwork updateTime + * @property {string|null} [description] VmwareEngineNetwork description + * @property {Array.|null} [vpcNetworks] VmwareEngineNetwork vpcNetworks + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State|null} [state] VmwareEngineNetwork state + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type|null} [type] VmwareEngineNetwork type + * @property {string|null} [uid] VmwareEngineNetwork uid + * @property {string|null} [etag] VmwareEngineNetwork etag + */ + + /** + * Constructs a new VmwareEngineNetwork. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a VmwareEngineNetwork. + * @implements IVmwareEngineNetwork + * @constructor + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set + */ + function VmwareEngineNetwork(properties) { + this.vpcNetworks = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VmwareEngineNetwork name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.name = ""; + + /** + * VmwareEngineNetwork createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.createTime = null; + + /** + * VmwareEngineNetwork updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.updateTime = null; + + /** + * VmwareEngineNetwork description. + * @member {string} description + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.description = ""; + + /** + * VmwareEngineNetwork vpcNetworks. + * @member {Array.} vpcNetworks + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.vpcNetworks = $util.emptyArray; + + /** + * VmwareEngineNetwork state. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.State} state + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.state = 0; + + /** + * VmwareEngineNetwork type. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type} type + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.type = 0; + + /** + * VmwareEngineNetwork uid. + * @member {string} uid + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.uid = ""; + + /** + * VmwareEngineNetwork etag. + * @member {string} etag + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + */ + VmwareEngineNetwork.prototype.etag = ""; + + /** + * Creates a new VmwareEngineNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork instance + */ + VmwareEngineNetwork.create = function create(properties) { + return new VmwareEngineNetwork(properties); + }; + + /** + * Encodes the specified VmwareEngineNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEngineNetwork.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 5, wireType 2 =*/42).string(message.description); + if (message.vpcNetworks != null && message.vpcNetworks.length) + for (var i = 0; i < message.vpcNetworks.length; ++i) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.encode(message.vpcNetworks[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.type); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.uid); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.etag); + return writer; + }; + + /** + * Encodes the specified VmwareEngineNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {google.cloud.vmwareengine.v1.IVmwareEngineNetwork} message VmwareEngineNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VmwareEngineNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VmwareEngineNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEngineNetwork.decode = function 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.vmwareengine.v1.VmwareEngineNetwork(); + 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 5: { + message.description = reader.string(); + break; + } + case 6: { + if (!(message.vpcNetworks && message.vpcNetworks.length)) + message.vpcNetworks = []; + message.vpcNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.type = reader.int32(); + break; + } + case 9: { + message.uid = reader.string(); + break; + } + case 10: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VmwareEngineNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VmwareEngineNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VmwareEngineNetwork message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VmwareEngineNetwork.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.vpcNetworks != null && message.hasOwnProperty("vpcNetworks")) { + if (!Array.isArray(message.vpcNetworks)) + return "vpcNetworks: array expected"; + for (var i = 0; i < message.vpcNetworks.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify(message.vpcNetworks[i]); + if (error) + return "vpcNetworks." + 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: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a VmwareEngineNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork} VmwareEngineNetwork + */ + VmwareEngineNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork) + return object; + var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork(); + if (object.name != null) + message.name = String(object.name); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.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.vmwareengine.v1.VmwareEngineNetwork.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.description != null) + message.description = String(object.description); + if (object.vpcNetworks) { + if (!Array.isArray(object.vpcNetworks)) + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: array expected"); + message.vpcNetworks = []; + for (var i = 0; i < object.vpcNetworks.length; ++i) { + if (typeof object.vpcNetworks[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.VmwareEngineNetwork.vpcNetworks: object expected"); + message.vpcNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.fromObject(object.vpcNetworks[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "LEGACY": + case 1: + message.type = 1; + break; + } + if (object.uid != null) + message.uid = String(object.uid); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a VmwareEngineNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} message VmwareEngineNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VmwareEngineNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.vpcNetworks = []; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.uid = ""; + object.etag = ""; + } + 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.vpcNetworks && message.vpcNetworks.length) { + object.vpcNetworks = []; + for (var j = 0; j < message.vpcNetworks.length; ++j) + object.vpcNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.toObject(message.vpcNetworks[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] === undefined ? message.state : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.State[message.state] : message.state; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type[message.type] : message.type; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this VmwareEngineNetwork to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @instance + * @returns {Object.} JSON object + */ + VmwareEngineNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VmwareEngineNetwork + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VmwareEngineNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork"; + }; + + VmwareEngineNetwork.VpcNetwork = (function() { + + /** + * Properties of a VpcNetwork. + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @interface IVpcNetwork + * @property {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type|null} [type] VpcNetwork type + * @property {string|null} [network] VpcNetwork network + */ + + /** + * Constructs a new VpcNetwork. + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork + * @classdesc Represents a VpcNetwork. + * @implements IVpcNetwork + * @constructor + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set + */ + function VpcNetwork(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VpcNetwork type. + * @member {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type} type + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @instance + */ + VpcNetwork.prototype.type = 0; + + /** + * VpcNetwork network. + * @member {string} network + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @instance + */ + VpcNetwork.prototype.network = ""; + + /** + * Creates a new VpcNetwork instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork instance + */ + VpcNetwork.create = function create(properties) { + return new VpcNetwork(properties); + }; + + /** + * Encodes the specified VpcNetwork message. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetwork.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.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.network); + return writer; + }; + + /** + * Encodes the specified VpcNetwork message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.IVpcNetwork} message VpcNetwork message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VpcNetwork.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetwork.decode = function 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.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.network = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VpcNetwork message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VpcNetwork.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VpcNetwork message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VpcNetwork.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.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + return null; + }; + + /** + * Creates a VpcNetwork message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} VpcNetwork + */ + VpcNetwork.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork) + return object; + var message = new $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork(); + 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 "INTRANET": + case 1: + message.type = 1; + break; + case "INTERNET": + case 2: + message.type = 2; + break; + case "GOOGLE_CLOUD": + case 3: + message.type = 3; + break; + } + if (object.network != null) + message.network = String(object.network); + return message; + }; + + /** + * Creates a plain object from a VpcNetwork message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork} message VpcNetwork + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VpcNetwork.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.network = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] === undefined ? message.type : $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type[message.type] : message.type; + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + return object; + }; + + /** + * Converts this VpcNetwork to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @instance + * @returns {Object.} JSON object + */ + VpcNetwork.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for VpcNetwork + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + VpcNetwork.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork"; + }; + + /** + * Type enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} INTRANET=1 INTRANET value + * @property {number} INTERNET=2 INTERNET value + * @property {number} GOOGLE_CLOUD=3 GOOGLE_CLOUD value + */ + VpcNetwork.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTRANET"] = 1; + values[valuesById[2] = "INTERNET"] = 2; + values[valuesById[3] = "GOOGLE_CLOUD"] = 3; + return values; + })(); + + return VpcNetwork; + })(); + + /** + * State enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} ACTIVE=2 ACTIVE value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + */ + VmwareEngineNetwork.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "ACTIVE"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + /** + * Type enum. + * @name google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} LEGACY=1 LEGACY value + */ + VmwareEngineNetwork.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEGACY"] = 1; + return values; + })(); + + return VmwareEngineNetwork; + })(); + + v1.CreateVmwareEngineNetworkRequest = (function() { + + /** + * Properties of a CreateVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface ICreateVmwareEngineNetworkRequest + * @property {string|null} [parent] CreateVmwareEngineNetworkRequest parent + * @property {string|null} [vmwareEngineNetworkId] CreateVmwareEngineNetworkRequest vmwareEngineNetworkId + * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] CreateVmwareEngineNetworkRequest vmwareEngineNetwork + * @property {string|null} [requestId] CreateVmwareEngineNetworkRequest requestId + */ + + /** + * Constructs a new CreateVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a CreateVmwareEngineNetworkRequest. + * @implements ICreateVmwareEngineNetworkRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set + */ + function CreateVmwareEngineNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateVmwareEngineNetworkRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + */ + CreateVmwareEngineNetworkRequest.prototype.parent = ""; + + /** + * CreateVmwareEngineNetworkRequest vmwareEngineNetworkId. + * @member {string} vmwareEngineNetworkId + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + */ + CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetworkId = ""; + + /** + * CreateVmwareEngineNetworkRequest vmwareEngineNetwork. + * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + */ + CreateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; + + /** + * CreateVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + */ + CreateVmwareEngineNetworkRequest.prototype.requestId = ""; + + /** + * Creates a new CreateVmwareEngineNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest instance + */ + CreateVmwareEngineNetworkRequest.create = function create(properties) { + return new CreateVmwareEngineNetworkRequest(properties); + }; + + /** + * Encodes the specified CreateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVmwareEngineNetworkRequest.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.vmwareEngineNetworkId != null && Object.hasOwnProperty.call(message, "vmwareEngineNetworkId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.vmwareEngineNetworkId); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, 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 CreateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVmwareEngineNetworkRequest.decode = function 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.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.vmwareEngineNetworkId = reader.string(); + break; + } + case 3: { + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateVmwareEngineNetworkRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateVmwareEngineNetworkRequest.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.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) + if (!$util.isString(message.vmwareEngineNetworkId)) + return "vmwareEngineNetworkId: string expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); + if (error) + return "vmwareEngineNetwork." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} CreateVmwareEngineNetworkRequest + */ + CreateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.vmwareEngineNetworkId != null) + message.vmwareEngineNetworkId = String(object.vmwareEngineNetworkId); + if (object.vmwareEngineNetwork != null) { + if (typeof object.vmwareEngineNetwork !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest} message CreateVmwareEngineNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.vmwareEngineNetworkId = ""; + object.vmwareEngineNetwork = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.vmwareEngineNetworkId != null && message.hasOwnProperty("vmwareEngineNetworkId")) + object.vmwareEngineNetworkId = message.vmwareEngineNetworkId; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateVmwareEngineNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + CreateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateVmwareEngineNetworkRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest"; + }; + + return CreateVmwareEngineNetworkRequest; + })(); + + v1.UpdateVmwareEngineNetworkRequest = (function() { + + /** + * Properties of an UpdateVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IUpdateVmwareEngineNetworkRequest + * @property {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null} [vmwareEngineNetwork] UpdateVmwareEngineNetworkRequest vmwareEngineNetwork + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateVmwareEngineNetworkRequest updateMask + * @property {string|null} [requestId] UpdateVmwareEngineNetworkRequest requestId + */ + + /** + * Constructs a new UpdateVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents an UpdateVmwareEngineNetworkRequest. + * @implements IUpdateVmwareEngineNetworkRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set + */ + function UpdateVmwareEngineNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateVmwareEngineNetworkRequest vmwareEngineNetwork. + * @member {google.cloud.vmwareengine.v1.IVmwareEngineNetwork|null|undefined} vmwareEngineNetwork + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + */ + UpdateVmwareEngineNetworkRequest.prototype.vmwareEngineNetwork = null; + + /** + * UpdateVmwareEngineNetworkRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + */ + UpdateVmwareEngineNetworkRequest.prototype.updateMask = null; + + /** + * UpdateVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + */ + UpdateVmwareEngineNetworkRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateVmwareEngineNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest instance + */ + UpdateVmwareEngineNetworkRequest.create = function create(properties) { + return new UpdateVmwareEngineNetworkRequest(properties); + }; + + /** + * Encodes the specified UpdateVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVmwareEngineNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmwareEngineNetwork != null && Object.hasOwnProperty.call(message, "vmwareEngineNetwork")) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetwork, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVmwareEngineNetworkRequest.decode = function 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.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateVmwareEngineNetworkRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateVmwareEngineNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetwork); + if (error) + return "vmwareEngineNetwork." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} UpdateVmwareEngineNetworkRequest + */ + UpdateVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest(); + if (object.vmwareEngineNetwork != null) { + if (typeof object.vmwareEngineNetwork !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.vmwareEngineNetwork: object expected"); + message.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetwork); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest} message UpdateVmwareEngineNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.vmwareEngineNetwork = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.vmwareEngineNetwork != null && message.hasOwnProperty("vmwareEngineNetwork")) + object.vmwareEngineNetwork = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetwork, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateVmwareEngineNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateVmwareEngineNetworkRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest"; + }; + + return UpdateVmwareEngineNetworkRequest; + })(); + + v1.DeleteVmwareEngineNetworkRequest = (function() { + + /** + * Properties of a DeleteVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IDeleteVmwareEngineNetworkRequest + * @property {string|null} [name] DeleteVmwareEngineNetworkRequest name + * @property {string|null} [requestId] DeleteVmwareEngineNetworkRequest requestId + * @property {string|null} [etag] DeleteVmwareEngineNetworkRequest etag + */ + + /** + * Constructs a new DeleteVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a DeleteVmwareEngineNetworkRequest. + * @implements IDeleteVmwareEngineNetworkRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set + */ + function DeleteVmwareEngineNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteVmwareEngineNetworkRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @instance + */ + DeleteVmwareEngineNetworkRequest.prototype.name = ""; + + /** + * DeleteVmwareEngineNetworkRequest requestId. + * @member {string} requestId + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @instance + */ + DeleteVmwareEngineNetworkRequest.prototype.requestId = ""; + + /** + * DeleteVmwareEngineNetworkRequest etag. + * @member {string} etag + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @instance + */ + DeleteVmwareEngineNetworkRequest.prototype.etag = ""; + + /** + * Creates a new DeleteVmwareEngineNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest instance + */ + DeleteVmwareEngineNetworkRequest.create = function create(properties) { + return new DeleteVmwareEngineNetworkRequest(properties); + }; + + /** + * Encodes the specified DeleteVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVmwareEngineNetworkRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.requestId); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.etag); + return writer; + }; + + /** + * Encodes the specified DeleteVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVmwareEngineNetworkRequest.decode = function 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.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.requestId = reader.string(); + break; + } + case 3: { + message.etag = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteVmwareEngineNetworkRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteVmwareEngineNetworkRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + return null; + }; + + /** + * Creates a DeleteVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} DeleteVmwareEngineNetworkRequest + */ + DeleteVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.etag != null) + message.etag = String(object.etag); + return message; + }; + + /** + * Creates a plain object from a DeleteVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest} message DeleteVmwareEngineNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteVmwareEngineNetworkRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.etag = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + return object; + }; + + /** + * Converts this DeleteVmwareEngineNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteVmwareEngineNetworkRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest"; + }; + + return DeleteVmwareEngineNetworkRequest; + })(); + + v1.GetVmwareEngineNetworkRequest = (function() { + + /** + * Properties of a GetVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IGetVmwareEngineNetworkRequest + * @property {string|null} [name] GetVmwareEngineNetworkRequest name + */ + + /** + * Constructs a new GetVmwareEngineNetworkRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a GetVmwareEngineNetworkRequest. + * @implements IGetVmwareEngineNetworkRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set + */ + function GetVmwareEngineNetworkRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetVmwareEngineNetworkRequest name. + * @member {string} name + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @instance + */ + GetVmwareEngineNetworkRequest.prototype.name = ""; + + /** + * Creates a new GetVmwareEngineNetworkRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest instance + */ + GetVmwareEngineNetworkRequest.create = function create(properties) { + return new GetVmwareEngineNetworkRequest(properties); + }; + + /** + * Encodes the specified GetVmwareEngineNetworkRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVmwareEngineNetworkRequest.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 GetVmwareEngineNetworkRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetVmwareEngineNetworkRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetVmwareEngineNetworkRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVmwareEngineNetworkRequest.decode = function 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.vmwareengine.v1.GetVmwareEngineNetworkRequest(); + 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 GetVmwareEngineNetworkRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetVmwareEngineNetworkRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetVmwareEngineNetworkRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetVmwareEngineNetworkRequest.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 GetVmwareEngineNetworkRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} GetVmwareEngineNetworkRequest + */ + GetVmwareEngineNetworkRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetVmwareEngineNetworkRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest} message GetVmwareEngineNetworkRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetVmwareEngineNetworkRequest.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 GetVmwareEngineNetworkRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @instance + * @returns {Object.} JSON object + */ + GetVmwareEngineNetworkRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetVmwareEngineNetworkRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetVmwareEngineNetworkRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest"; + }; + + return GetVmwareEngineNetworkRequest; + })(); + + v1.ListVmwareEngineNetworksRequest = (function() { + + /** + * Properties of a ListVmwareEngineNetworksRequest. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListVmwareEngineNetworksRequest + * @property {string|null} [parent] ListVmwareEngineNetworksRequest parent + * @property {number|null} [pageSize] ListVmwareEngineNetworksRequest pageSize + * @property {string|null} [pageToken] ListVmwareEngineNetworksRequest pageToken + * @property {string|null} [filter] ListVmwareEngineNetworksRequest filter + * @property {string|null} [orderBy] ListVmwareEngineNetworksRequest orderBy + */ + + /** + * Constructs a new ListVmwareEngineNetworksRequest. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListVmwareEngineNetworksRequest. + * @implements IListVmwareEngineNetworksRequest + * @constructor + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set + */ + function ListVmwareEngineNetworksRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListVmwareEngineNetworksRequest parent. + * @member {string} parent + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.parent = ""; + + /** + * ListVmwareEngineNetworksRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.pageSize = 0; + + /** + * ListVmwareEngineNetworksRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.pageToken = ""; + + /** + * ListVmwareEngineNetworksRequest filter. + * @member {string} filter + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.filter = ""; + + /** + * ListVmwareEngineNetworksRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + */ + ListVmwareEngineNetworksRequest.prototype.orderBy = ""; + + /** + * Creates a new ListVmwareEngineNetworksRequest instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest instance + */ + ListVmwareEngineNetworksRequest.create = function create(properties) { + return new ListVmwareEngineNetworksRequest(properties); + }; + + /** + * Encodes the specified ListVmwareEngineNetworksRequest message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVmwareEngineNetworksRequest.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 ListVmwareEngineNetworksRequest message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVmwareEngineNetworksRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVmwareEngineNetworksRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVmwareEngineNetworksRequest.decode = function 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.vmwareengine.v1.ListVmwareEngineNetworksRequest(); + 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 ListVmwareEngineNetworksRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVmwareEngineNetworksRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVmwareEngineNetworksRequest message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVmwareEngineNetworksRequest.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 ListVmwareEngineNetworksRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} ListVmwareEngineNetworksRequest + */ + ListVmwareEngineNetworksRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest(); + 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 ListVmwareEngineNetworksRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest} message ListVmwareEngineNetworksRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVmwareEngineNetworksRequest.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 ListVmwareEngineNetworksRequest to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @instance + * @returns {Object.} JSON object + */ + ListVmwareEngineNetworksRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVmwareEngineNetworksRequest + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVmwareEngineNetworksRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest"; + }; + + return ListVmwareEngineNetworksRequest; + })(); + + v1.ListVmwareEngineNetworksResponse = (function() { + + /** + * Properties of a ListVmwareEngineNetworksResponse. + * @memberof google.cloud.vmwareengine.v1 + * @interface IListVmwareEngineNetworksResponse + * @property {Array.|null} [vmwareEngineNetworks] ListVmwareEngineNetworksResponse vmwareEngineNetworks + * @property {string|null} [nextPageToken] ListVmwareEngineNetworksResponse nextPageToken + * @property {Array.|null} [unreachable] ListVmwareEngineNetworksResponse unreachable + */ + + /** + * Constructs a new ListVmwareEngineNetworksResponse. + * @memberof google.cloud.vmwareengine.v1 + * @classdesc Represents a ListVmwareEngineNetworksResponse. + * @implements IListVmwareEngineNetworksResponse + * @constructor + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set + */ + function ListVmwareEngineNetworksResponse(properties) { + this.vmwareEngineNetworks = []; + 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]]; + } + + /** + * ListVmwareEngineNetworksResponse vmwareEngineNetworks. + * @member {Array.} vmwareEngineNetworks + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @instance + */ + ListVmwareEngineNetworksResponse.prototype.vmwareEngineNetworks = $util.emptyArray; + + /** + * ListVmwareEngineNetworksResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @instance + */ + ListVmwareEngineNetworksResponse.prototype.nextPageToken = ""; + + /** + * ListVmwareEngineNetworksResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @instance + */ + ListVmwareEngineNetworksResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListVmwareEngineNetworksResponse instance using the specified properties. + * @function create + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse=} [properties] Properties to set + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse instance + */ + ListVmwareEngineNetworksResponse.create = function create(properties) { + return new ListVmwareEngineNetworksResponse(properties); + }; + + /** + * Encodes the specified ListVmwareEngineNetworksResponse message. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVmwareEngineNetworksResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.vmwareEngineNetworks != null && message.vmwareEngineNetworks.length) + for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) + $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.encode(message.vmwareEngineNetworks[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 ListVmwareEngineNetworksResponse message, length delimited. Does not implicitly {@link google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListVmwareEngineNetworksResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListVmwareEngineNetworksResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVmwareEngineNetworksResponse.decode = function 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.vmwareengine.v1.ListVmwareEngineNetworksResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.vmwareEngineNetworks && message.vmwareEngineNetworks.length)) + message.vmwareEngineNetworks = []; + message.vmwareEngineNetworks.push($root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.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 ListVmwareEngineNetworksResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListVmwareEngineNetworksResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListVmwareEngineNetworksResponse message. + * @function verify + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListVmwareEngineNetworksResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.vmwareEngineNetworks != null && message.hasOwnProperty("vmwareEngineNetworks")) { + if (!Array.isArray(message.vmwareEngineNetworks)) + return "vmwareEngineNetworks: array expected"; + for (var i = 0; i < message.vmwareEngineNetworks.length; ++i) { + var error = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.verify(message.vmwareEngineNetworks[i]); + if (error) + return "vmwareEngineNetworks." + 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 ListVmwareEngineNetworksResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} ListVmwareEngineNetworksResponse + */ + ListVmwareEngineNetworksResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse) + return object; + var message = new $root.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse(); + if (object.vmwareEngineNetworks) { + if (!Array.isArray(object.vmwareEngineNetworks)) + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: array expected"); + message.vmwareEngineNetworks = []; + for (var i = 0; i < object.vmwareEngineNetworks.length; ++i) { + if (typeof object.vmwareEngineNetworks[i] !== "object") + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.vmwareEngineNetworks: object expected"); + message.vmwareEngineNetworks[i] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.fromObject(object.vmwareEngineNetworks[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse.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 ListVmwareEngineNetworksResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse} message ListVmwareEngineNetworksResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListVmwareEngineNetworksResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.vmwareEngineNetworks = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.vmwareEngineNetworks && message.vmwareEngineNetworks.length) { + object.vmwareEngineNetworks = []; + for (var j = 0; j < message.vmwareEngineNetworks.length; ++j) + object.vmwareEngineNetworks[j] = $root.google.cloud.vmwareengine.v1.VmwareEngineNetwork.toObject(message.vmwareEngineNetworks[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 ListVmwareEngineNetworksResponse to JSON. + * @function toJSON + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @instance + * @returns {Object.} JSON object + */ + ListVmwareEngineNetworksResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListVmwareEngineNetworksResponse + * @function getTypeUrl + * @memberof google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListVmwareEngineNetworksResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse"; + }; + + return ListVmwareEngineNetworksResponse; + })(); + + return v1; + })(); + + return vmwareengine; + })(); + + 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; + })(); + + return rpc; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-vmwareengine/protos/protos.json b/packages/google-cloud-vmwareengine/protos/protos.json new file mode 100644 index 00000000000..b07e0bb1d86 --- /dev/null +++ b/packages/google-cloud-vmwareengine/protos/protos.json @@ -0,0 +1,3813 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "vmwareengine": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.VmwareEngine.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/vmwareengine/v1;vmwareengine", + "java_multiple_files": true, + "java_outer_classname": "VmwareengineProto", + "java_package": "com.google.cloud.vmwareengine.v1", + "php_namespace": "Google\\Cloud\\VmwareEngine\\V1", + "ruby_package": "Google::Cloud::VmwareEngine::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/Network", + "(google.api.resource_definition).pattern": "projects/{project}/global/networks/{network}" + }, + "nested": { + "VmwareEngine": { + "options": { + "(google.api.default_host)": "vmwareengine.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListPrivateClouds": { + "requestType": "ListPrivateCloudsRequest", + "responseType": "ListPrivateCloudsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/privateClouds", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/privateClouds" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetPrivateCloud": { + "requestType": "GetPrivateCloudRequest", + "responseType": "PrivateCloud", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateClouds/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateClouds/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreatePrivateCloud": { + "requestType": "CreatePrivateCloudRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/privateClouds", + "(google.api.http).body": "private_cloud", + "(google.api.method_signature)": "parent,private_cloud,private_cloud_id", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/privateClouds", + "body": "private_cloud" + } + }, + { + "(google.api.method_signature)": "parent,private_cloud,private_cloud_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdatePrivateCloud": { + "requestType": "UpdatePrivateCloudRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{private_cloud.name=projects/*/locations/*/privateClouds/*}", + "(google.api.http).body": "private_cloud", + "(google.api.method_signature)": "private_cloud,update_mask", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{private_cloud.name=projects/*/locations/*/privateClouds/*}", + "body": "private_cloud" + } + }, + { + "(google.api.method_signature)": "private_cloud,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeletePrivateCloud": { + "requestType": "DeletePrivateCloudRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/privateClouds/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/privateClouds/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UndeletePrivateCloud": { + "requestType": "UndeletePrivateCloudRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/privateClouds/*}:undelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/privateClouds/*}:undelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListClusters": { + "requestType": "ListClustersRequest", + "responseType": "ListClustersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetCluster": { + "requestType": "GetClusterRequest", + "responseType": "Cluster", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateClouds/*/clusters/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateClouds/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCluster": { + "requestType": "CreateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "parent,cluster,cluster_id", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/privateClouds/*}/clusters", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "parent,cluster,cluster_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateCluster": { + "requestType": "UpdateClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{cluster.name=projects/*/locations/*/privateClouds/*/clusters/*}", + "(google.api.http).body": "cluster", + "(google.api.method_signature)": "cluster,update_mask", + "(google.longrunning.operation_info).response_type": "Cluster", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{cluster.name=projects/*/locations/*/privateClouds/*/clusters/*}", + "body": "cluster" + } + }, + { + "(google.api.method_signature)": "cluster,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Cluster", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteCluster": { + "requestType": "DeleteClusterRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/privateClouds/*/clusters/*}", + "(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/*/privateClouds/*/clusters/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListSubnets": { + "requestType": "ListSubnetsRequest", + "responseType": "ListSubnetsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/subnets", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/subnets" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListNodeTypes": { + "requestType": "ListNodeTypesRequest", + "responseType": "ListNodeTypesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/nodeTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/nodeTypes" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetNodeType": { + "requestType": "GetNodeTypeRequest", + "responseType": "NodeType", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/nodeTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/nodeTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ShowNsxCredentials": { + "requestType": "ShowNsxCredentialsRequest", + "responseType": "Credentials", + "options": { + "(google.api.http).get": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showNsxCredentials", + "(google.api.method_signature)": "private_cloud" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showNsxCredentials" + } + }, + { + "(google.api.method_signature)": "private_cloud" + } + ] + }, + "ShowVcenterCredentials": { + "requestType": "ShowVcenterCredentialsRequest", + "responseType": "Credentials", + "options": { + "(google.api.http).get": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showVcenterCredentials", + "(google.api.method_signature)": "private_cloud" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showVcenterCredentials" + } + }, + { + "(google.api.method_signature)": "private_cloud" + } + ] + }, + "ResetNsxCredentials": { + "requestType": "ResetNsxCredentialsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetNsxCredentials", + "(google.api.http).body": "*", + "(google.api.method_signature)": "private_cloud", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetNsxCredentials", + "body": "*" + } + }, + { + "(google.api.method_signature)": "private_cloud" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ResetVcenterCredentials": { + "requestType": "ResetVcenterCredentialsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetVcenterCredentials", + "(google.api.http).body": "*", + "(google.api.method_signature)": "private_cloud", + "(google.longrunning.operation_info).response_type": "PrivateCloud", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetVcenterCredentials", + "body": "*" + } + }, + { + "(google.api.method_signature)": "private_cloud" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "PrivateCloud", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateHcxActivationKey": { + "requestType": "CreateHcxActivationKeyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys", + "(google.api.http).body": "hcx_activation_key", + "(google.api.method_signature)": "parent,hcx_activation_key,hcx_activation_key_id", + "(google.longrunning.operation_info).response_type": "HcxActivationKey", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys", + "body": "hcx_activation_key" + } + }, + { + "(google.api.method_signature)": "parent,hcx_activation_key,hcx_activation_key_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "HcxActivationKey", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListHcxActivationKeys": { + "requestType": "ListHcxActivationKeysRequest", + "responseType": "ListHcxActivationKeysResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetHcxActivationKey": { + "requestType": "GetHcxActivationKeyRequest", + "responseType": "HcxActivationKey", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "GetNetworkPolicy": { + "requestType": "GetNetworkPolicyRequest", + "responseType": "NetworkPolicy", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/networkPolicies/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/networkPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListNetworkPolicies": { + "requestType": "ListNetworkPoliciesRequest", + "responseType": "ListNetworkPoliciesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/networkPolicies", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/networkPolicies" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateNetworkPolicy": { + "requestType": "CreateNetworkPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/networkPolicies", + "(google.api.http).body": "network_policy", + "(google.api.method_signature)": "parent,network_policy,network_policy_id", + "(google.longrunning.operation_info).response_type": "NetworkPolicy", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/networkPolicies", + "body": "network_policy" + } + }, + { + "(google.api.method_signature)": "parent,network_policy,network_policy_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NetworkPolicy", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateNetworkPolicy": { + "requestType": "UpdateNetworkPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{network_policy.name=projects/*/locations/*/networkPolicies/*}", + "(google.api.http).body": "network_policy", + "(google.api.method_signature)": "network_policy,update_mask", + "(google.longrunning.operation_info).response_type": "NetworkPolicy", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{network_policy.name=projects/*/locations/*/networkPolicies/*}", + "body": "network_policy" + } + }, + { + "(google.api.method_signature)": "network_policy,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "NetworkPolicy", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteNetworkPolicy": { + "requestType": "DeleteNetworkPolicyRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/networkPolicies/*}", + "(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/*/networkPolicies/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateVmwareEngineNetwork": { + "requestType": "CreateVmwareEngineNetworkRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks", + "(google.api.http).body": "vmware_engine_network", + "(google.api.method_signature)": "parent,vmware_engine_network,vmware_engine_network_id", + "(google.longrunning.operation_info).response_type": "VmwareEngineNetwork", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks", + "body": "vmware_engine_network" + } + }, + { + "(google.api.method_signature)": "parent,vmware_engine_network,vmware_engine_network_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "VmwareEngineNetwork", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateVmwareEngineNetwork": { + "requestType": "UpdateVmwareEngineNetworkRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{vmware_engine_network.name=projects/*/locations/*/vmwareEngineNetworks/*}", + "(google.api.http).body": "vmware_engine_network", + "(google.api.method_signature)": "vmware_engine_network,update_mask", + "(google.longrunning.operation_info).response_type": "VmwareEngineNetwork", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{vmware_engine_network.name=projects/*/locations/*/vmwareEngineNetworks/*}", + "body": "vmware_engine_network" + } + }, + { + "(google.api.method_signature)": "vmware_engine_network,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "VmwareEngineNetwork", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteVmwareEngineNetwork": { + "requestType": "DeleteVmwareEngineNetworkRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}", + "(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/*/vmwareEngineNetworks/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetVmwareEngineNetwork": { + "requestType": "GetVmwareEngineNetworkRequest", + "responseType": "VmwareEngineNetwork", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListVmwareEngineNetworks": { + "requestType": "ListVmwareEngineNetworksRequest", + "responseType": "ListVmwareEngineNetworksResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "managementCidr": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmwareEngineNetwork": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "vmwareEngineNetworkCanonical": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "managementIpAddressLayoutVersion": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "NodeTypeConfig": { + "fields": { + "nodeCount": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "customCoreCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "PrivateCloud": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/PrivateCloud", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateClouds/{private_cloud}" + }, + "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" + } + }, + "deleteTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "managementCluster": { + "type": "ManagementCluster", + "id": 10, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 11 + }, + "hcx": { + "type": "Hcx", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nsx": { + "type": "Nsx", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vcenter": { + "type": "Vcenter", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "UPDATING": 3, + "FAILED": 5, + "DELETED": 6, + "PURGING": 7 + } + }, + "ManagementCluster": { + "fields": { + "clusterId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "nodeTypeConfigs": { + "keyType": "string", + "type": "NodeTypeConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "ListPrivateCloudsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListPrivateCloudsResponse": { + "fields": { + "privateClouds": { + "rule": "repeated", + "type": "PrivateCloud", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetPrivateCloudRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + } + } + }, + "CreatePrivateCloudRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "privateCloudId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "privateCloud": { + "type": "PrivateCloud", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdatePrivateCloudRequest": { + "fields": { + "privateCloud": { + "type": "PrivateCloud", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeletePrivateCloudRequest": { + "oneofs": { + "_delayHours": { + "oneof": [ + "delayHours" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "delayHours": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "UndeletePrivateCloudRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Cluster": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/Cluster", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}" + }, + "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" + } + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "management": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeTypeConfigs": { + "keyType": "string", + "type": "NodeTypeConfig", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "UPDATING": 3, + "DELETING": 4, + "REPAIRING": 5 + } + } + } + }, + "ListClustersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListClustersResponse": { + "fields": { + "clusters": { + "rule": "repeated", + "type": "Cluster", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/Cluster" + } + } + } + }, + "CreateClusterRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "clusterId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateClusterRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "cluster": { + "type": "Cluster", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteClusterRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/Cluster" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Subnet": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/Subnet", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "ipCidrRange": { + "type": "string", + "id": 7 + }, + "gatewayIp": { + "type": "string", + "id": 8 + }, + "type": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2, + "UPDATING": 3, + "DELETING": 4 + } + } + } + }, + "ListSubnetsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSubnetsResponse": { + "fields": { + "subnets": { + "rule": "repeated", + "type": "Subnet", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "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" + } + } + } + }, + "NodeType": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/NodeType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/nodeTypes/{node_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nodeTypeId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "virtualCpuCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalCoreCount": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "memoryGb": { + "type": "int32", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diskSizeGb": { + "type": "int32", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "availableCustomCoreCounts": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ListNodeTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListNodeTypesResponse": { + "fields": { + "nodeTypes": { + "rule": "repeated", + "type": "NodeType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetNodeTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/NodeType" + } + } + } + }, + "Credentials": { + "fields": { + "username": { + "type": "string", + "id": 1 + }, + "password": { + "type": "string", + "id": 2 + } + } + }, + "ShowNsxCredentialsRequest": { + "fields": { + "privateCloud": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + } + } + }, + "ShowVcenterCredentialsRequest": { + "fields": { + "privateCloud": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + } + } + }, + "ResetNsxCredentialsRequest": { + "fields": { + "privateCloud": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ResetVcenterCredentialsRequest": { + "fields": { + "privateCloud": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListHcxActivationKeysResponse": { + "fields": { + "hcxActivationKeys": { + "rule": "repeated", + "type": "HcxActivationKey", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "HcxActivationKey": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/HcxActivationKey", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}" + }, + "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" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "activationKey": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "AVAILABLE": 1, + "CONSUMED": 2, + "CREATING": 3 + } + } + } + }, + "ListHcxActivationKeysRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "GetHcxActivationKeyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/HcxActivationKey" + } + } + } + }, + "CreateHcxActivationKeyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/PrivateCloud" + } + }, + "hcxActivationKey": { + "type": "HcxActivationKey", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hcxActivationKeyId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4 + } + } + }, + "Hcx": { + "fields": { + "internalIp": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 4 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fqdn": { + "type": "string", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2 + } + } + } + }, + "Nsx": { + "fields": { + "internalIp": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 4 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fqdn": { + "type": "string", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2 + } + } + } + }, + "Vcenter": { + "fields": { + "internalIp": { + "type": "string", + "id": 2 + }, + "version": { + "type": "string", + "id": 4 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "fqdn": { + "type": "string", + "id": 6 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "CREATING": 2 + } + } + } + }, + "NetworkPolicy": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/NetworkPolicy", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/networkPolicies/{network_policy}" + }, + "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" + } + }, + "internetAccess": { + "type": "NetworkService", + "id": 6 + }, + "externalIp": { + "type": "NetworkService", + "id": 7 + }, + "edgeServicesCidr": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uid": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vmwareEngineNetwork": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "description": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "vmwareEngineNetworkCanonical": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + } + }, + "nested": { + "NetworkService": { + "fields": { + "enabled": { + "type": "bool", + "id": 1 + }, + "state": { + "type": "State", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "UNPROVISIONED": 1, + "RECONCILING": 2, + "ACTIVE": 3 + } + } + } + } + } + }, + "ListNetworkPoliciesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmwareengine.googleapis.com/NetworkPolicy" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListNetworkPoliciesResponse": { + "fields": { + "networkPolicies": { + "rule": "repeated", + "type": "NetworkPolicy", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetNetworkPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/NetworkPolicy" + } + } + } + }, + "UpdateNetworkPolicyRequest": { + "fields": { + "networkPolicy": { + "type": "NetworkPolicy", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateNetworkPolicyRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmwareengine.googleapis.com/NetworkPolicy" + } + }, + "networkPolicyId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "networkPolicy": { + "type": "NetworkPolicy", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteNetworkPolicyRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/NetworkPolicy" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "VmwareEngineNetwork": { + "options": { + "(google.api.resource).type": "vmwareengine.googleapis.com/VmwareEngineNetwork", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}" + }, + "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": 5 + }, + "vpcNetworks": { + "rule": "repeated", + "type": "VpcNetwork", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uid": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "etag": { + "type": "string", + "id": 10 + } + }, + "nested": { + "VpcNetwork": { + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "network": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "compute.googleapis.com/Network" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "INTRANET": 1, + "INTERNET": 2, + "GOOGLE_CLOUD": 3 + } + } + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "UPDATING": 3, + "DELETING": 4 + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "LEGACY": 1 + } + } + } + }, + "CreateVmwareEngineNetworkRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "vmwareEngineNetworkId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "vmwareEngineNetwork": { + "type": "VmwareEngineNetwork", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateVmwareEngineNetworkRequest": { + "fields": { + "vmwareEngineNetwork": { + "type": "VmwareEngineNetwork", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteVmwareEngineNetworkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "GetVmwareEngineNetworkRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "vmwareengine.googleapis.com/VmwareEngineNetwork" + } + } + } + }, + "ListVmwareEngineNetworksRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListVmwareEngineNetworksResponse": { + "fields": { + "vmwareEngineNetworks": { + "rule": "repeated", + "type": "VmwareEngineNetwork", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "fields": { + "file": { + "rule": "repeated", + "type": "FileDescriptorProto", + "id": 1 + } + } + }, + "FileDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "package": { + "type": "string", + "id": 2 + }, + "dependency": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "publicDependency": { + "rule": "repeated", + "type": "int32", + "id": 10, + "options": { + "packed": false + } + }, + "weakDependency": { + "rule": "repeated", + "type": "int32", + "id": 11, + "options": { + "packed": false + } + }, + "messageType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 4 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 5 + }, + "service": { + "rule": "repeated", + "type": "ServiceDescriptorProto", + "id": 6 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 7 + }, + "options": { + "type": "FileOptions", + "id": 8 + }, + "sourceCodeInfo": { + "type": "SourceCodeInfo", + "id": 9 + }, + "syntax": { + "type": "string", + "id": 12 + }, + "edition": { + "type": "string", + "id": 13 + } + } + }, + "DescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "field": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 2 + }, + "extension": { + "rule": "repeated", + "type": "FieldDescriptorProto", + "id": 6 + }, + "nestedType": { + "rule": "repeated", + "type": "DescriptorProto", + "id": 3 + }, + "enumType": { + "rule": "repeated", + "type": "EnumDescriptorProto", + "id": 4 + }, + "extensionRange": { + "rule": "repeated", + "type": "ExtensionRange", + "id": 5 + }, + "oneofDecl": { + "rule": "repeated", + "type": "OneofDescriptorProto", + "id": 8 + }, + "options": { + "type": "MessageOptions", + "id": 7 + }, + "reservedRange": { + "rule": "repeated", + "type": "ReservedRange", + "id": 9 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 10 + } + }, + "nested": { + "ExtensionRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "ExtensionRangeOptions", + "id": 3 + } + } + }, + "ReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "ExtensionRangeOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "FieldDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 3 + }, + "label": { + "type": "Label", + "id": 4 + }, + "type": { + "type": "Type", + "id": 5 + }, + "typeName": { + "type": "string", + "id": 6 + }, + "extendee": { + "type": "string", + "id": 2 + }, + "defaultValue": { + "type": "string", + "id": 7 + }, + "oneofIndex": { + "type": "int32", + "id": 9 + }, + "jsonName": { + "type": "string", + "id": 10 + }, + "options": { + "type": "FieldOptions", + "id": 8 + }, + "proto3Optional": { + "type": "bool", + "id": 17 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_DOUBLE": 1, + "TYPE_FLOAT": 2, + "TYPE_INT64": 3, + "TYPE_UINT64": 4, + "TYPE_INT32": 5, + "TYPE_FIXED64": 6, + "TYPE_FIXED32": 7, + "TYPE_BOOL": 8, + "TYPE_STRING": 9, + "TYPE_GROUP": 10, + "TYPE_MESSAGE": 11, + "TYPE_BYTES": 12, + "TYPE_UINT32": 13, + "TYPE_ENUM": 14, + "TYPE_SFIXED32": 15, + "TYPE_SFIXED64": 16, + "TYPE_SINT32": 17, + "TYPE_SINT64": 18 + } + }, + "Label": { + "values": { + "LABEL_OPTIONAL": 1, + "LABEL_REQUIRED": 2, + "LABEL_REPEATED": 3 + } + } + } + }, + "OneofDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "options": { + "type": "OneofOptions", + "id": 2 + } + } + }, + "EnumDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "value": { + "rule": "repeated", + "type": "EnumValueDescriptorProto", + "id": 2 + }, + "options": { + "type": "EnumOptions", + "id": 3 + }, + "reservedRange": { + "rule": "repeated", + "type": "EnumReservedRange", + "id": 4 + }, + "reservedName": { + "rule": "repeated", + "type": "string", + "id": 5 + } + }, + "nested": { + "EnumReservedRange": { + "fields": { + "start": { + "type": "int32", + "id": 1 + }, + "end": { + "type": "int32", + "id": 2 + } + } + } + } + }, + "EnumValueDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "number": { + "type": "int32", + "id": 2 + }, + "options": { + "type": "EnumValueOptions", + "id": 3 + } + } + }, + "ServiceDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "method": { + "rule": "repeated", + "type": "MethodDescriptorProto", + "id": 2 + }, + "options": { + "type": "ServiceOptions", + "id": 3 + } + } + }, + "MethodDescriptorProto": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "inputType": { + "type": "string", + "id": 2 + }, + "outputType": { + "type": "string", + "id": 3 + }, + "options": { + "type": "MethodOptions", + "id": 4 + }, + "clientStreaming": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "serverStreaming": { + "type": "bool", + "id": 6, + "options": { + "default": false + } + } + } + }, + "FileOptions": { + "fields": { + "javaPackage": { + "type": "string", + "id": 1 + }, + "javaOuterClassname": { + "type": "string", + "id": 8 + }, + "javaMultipleFiles": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "javaGenerateEqualsAndHash": { + "type": "bool", + "id": 20, + "options": { + "deprecated": true + } + }, + "javaStringCheckUtf8": { + "type": "bool", + "id": 27, + "options": { + "default": false + } + }, + "optimizeFor": { + "type": "OptimizeMode", + "id": 9, + "options": { + "default": "SPEED" + } + }, + "goPackage": { + "type": "string", + "id": 11 + }, + "ccGenericServices": { + "type": "bool", + "id": 16, + "options": { + "default": false + } + }, + "javaGenericServices": { + "type": "bool", + "id": 17, + "options": { + "default": false + } + }, + "pyGenericServices": { + "type": "bool", + "id": 18, + "options": { + "default": false + } + }, + "phpGenericServices": { + "type": "bool", + "id": 42, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 23, + "options": { + "default": false + } + }, + "ccEnableArenas": { + "type": "bool", + "id": 31, + "options": { + "default": true + } + }, + "objcClassPrefix": { + "type": "string", + "id": 36 + }, + "csharpNamespace": { + "type": "string", + "id": 37 + }, + "swiftPrefix": { + "type": "string", + "id": 39 + }, + "phpClassPrefix": { + "type": "string", + "id": 40 + }, + "phpNamespace": { + "type": "string", + "id": 41 + }, + "phpMetadataNamespace": { + "type": "string", + "id": 44 + }, + "rubyPackage": { + "type": "string", + "id": 45 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 38, + 38 + ] + ], + "nested": { + "OptimizeMode": { + "values": { + "SPEED": 1, + "CODE_SIZE": 2, + "LITE_RUNTIME": 3 + } + } + } + }, + "MessageOptions": { + "fields": { + "messageSetWireFormat": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "noStandardDescriptorAccessor": { + "type": "bool", + "id": 2, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "mapEntry": { + "type": "bool", + "id": 7 + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], + [ + 8, + 8 + ], + [ + 9, + 9 + ] + ] + }, + "FieldOptions": { + "fields": { + "ctype": { + "type": "CType", + "id": 1, + "options": { + "default": "STRING" + } + }, + "packed": { + "type": "bool", + "id": 2 + }, + "jstype": { + "type": "JSType", + "id": 6, + "options": { + "default": "JS_NORMAL" + } + }, + "lazy": { + "type": "bool", + "id": 5, + "options": { + "default": false + } + }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "weak": { + "type": "bool", + "id": 10, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 4, + 4 + ] + ], + "nested": { + "CType": { + "values": { + "STRING": 0, + "CORD": 1, + "STRING_PIECE": 2 + } + }, + "JSType": { + "values": { + "JS_NORMAL": 0, + "JS_STRING": 1, + "JS_NUMBER": 2 + } + } + } + }, + "OneofOptions": { + "fields": { + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "EnumOptions": { + "fields": { + "allowAlias": { + "type": "bool", + "id": 2 + }, + "deprecated": { + "type": "bool", + "id": 3, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "reserved": [ + [ + 5, + 5 + ] + ] + }, + "EnumValueOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 1, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "ServiceOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ] + }, + "MethodOptions": { + "fields": { + "deprecated": { + "type": "bool", + "id": 33, + "options": { + "default": false + } + }, + "idempotencyLevel": { + "type": "IdempotencyLevel", + "id": 34, + "options": { + "default": "IDEMPOTENCY_UNKNOWN" + } + }, + "uninterpretedOption": { + "rule": "repeated", + "type": "UninterpretedOption", + "id": 999 + } + }, + "extensions": [ + [ + 1000, + 536870911 + ] + ], + "nested": { + "IdempotencyLevel": { + "values": { + "IDEMPOTENCY_UNKNOWN": 0, + "NO_SIDE_EFFECTS": 1, + "IDEMPOTENT": 2 + } + } + } + }, + "UninterpretedOption": { + "fields": { + "name": { + "rule": "repeated", + "type": "NamePart", + "id": 2 + }, + "identifierValue": { + "type": "string", + "id": 3 + }, + "positiveIntValue": { + "type": "uint64", + "id": 4 + }, + "negativeIntValue": { + "type": "int64", + "id": 5 + }, + "doubleValue": { + "type": "double", + "id": 6 + }, + "stringValue": { + "type": "bytes", + "id": 7 + }, + "aggregateValue": { + "type": "string", + "id": 8 + } + }, + "nested": { + "NamePart": { + "fields": { + "namePart": { + "rule": "required", + "type": "string", + "id": 1 + }, + "isExtension": { + "rule": "required", + "type": "bool", + "id": 2 + } + } + } + } + }, + "SourceCodeInfo": { + "fields": { + "location": { + "rule": "repeated", + "type": "Location", + "id": 1 + } + }, + "nested": { + "Location": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "span": { + "rule": "repeated", + "type": "int32", + "id": 2 + }, + "leadingComments": { + "type": "string", + "id": 3 + }, + "trailingComments": { + "type": "string", + "id": 4 + }, + "leadingDetachedComments": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + } + } + }, + "GeneratedCodeInfo": { + "fields": { + "annotation": { + "rule": "repeated", + "type": "Annotation", + "id": 1 + } + }, + "nested": { + "Annotation": { + "fields": { + "path": { + "rule": "repeated", + "type": "int32", + "id": 1 + }, + "sourceFile": { + "type": "string", + "id": 2 + }, + "begin": { + "type": "int32", + "id": 3 + }, + "end": { + "type": "int32", + "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } + } + } + } + } + }, + "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/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-vmwareengine/samples/README.md b/packages/google-cloud-vmwareengine/samples/README.md new file mode 100644 index 00000000000..81f8f31aa18 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/README.md @@ -0,0 +1,626 @@ +[//]: # "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 + +# [VMware Engine API: Node.js Samples](https://github.com/googleapis/google-cloud-node) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Vmware_engine.create_cluster](#vmware_engine.create_cluster) + * [Vmware_engine.create_hcx_activation_key](#vmware_engine.create_hcx_activation_key) + * [Vmware_engine.create_network_policy](#vmware_engine.create_network_policy) + * [Vmware_engine.create_private_cloud](#vmware_engine.create_private_cloud) + * [Vmware_engine.create_vmware_engine_network](#vmware_engine.create_vmware_engine_network) + * [Vmware_engine.delete_cluster](#vmware_engine.delete_cluster) + * [Vmware_engine.delete_network_policy](#vmware_engine.delete_network_policy) + * [Vmware_engine.delete_private_cloud](#vmware_engine.delete_private_cloud) + * [Vmware_engine.delete_vmware_engine_network](#vmware_engine.delete_vmware_engine_network) + * [Vmware_engine.get_cluster](#vmware_engine.get_cluster) + * [Vmware_engine.get_hcx_activation_key](#vmware_engine.get_hcx_activation_key) + * [Vmware_engine.get_network_policy](#vmware_engine.get_network_policy) + * [Vmware_engine.get_node_type](#vmware_engine.get_node_type) + * [Vmware_engine.get_private_cloud](#vmware_engine.get_private_cloud) + * [Vmware_engine.get_vmware_engine_network](#vmware_engine.get_vmware_engine_network) + * [Vmware_engine.list_clusters](#vmware_engine.list_clusters) + * [Vmware_engine.list_hcx_activation_keys](#vmware_engine.list_hcx_activation_keys) + * [Vmware_engine.list_network_policies](#vmware_engine.list_network_policies) + * [Vmware_engine.list_node_types](#vmware_engine.list_node_types) + * [Vmware_engine.list_private_clouds](#vmware_engine.list_private_clouds) + * [Vmware_engine.list_subnets](#vmware_engine.list_subnets) + * [Vmware_engine.list_vmware_engine_networks](#vmware_engine.list_vmware_engine_networks) + * [Vmware_engine.reset_nsx_credentials](#vmware_engine.reset_nsx_credentials) + * [Vmware_engine.reset_vcenter_credentials](#vmware_engine.reset_vcenter_credentials) + * [Vmware_engine.show_nsx_credentials](#vmware_engine.show_nsx_credentials) + * [Vmware_engine.show_vcenter_credentials](#vmware_engine.show_vcenter_credentials) + * [Vmware_engine.undelete_private_cloud](#vmware_engine.undelete_private_cloud) + * [Vmware_engine.update_cluster](#vmware_engine.update_cluster) + * [Vmware_engine.update_network_policy](#vmware_engine.update_network_policy) + * [Vmware_engine.update_private_cloud](#vmware_engine.update_private_cloud) + * [Vmware_engine.update_vmware_engine_network](#vmware_engine.update_vmware_engine_network) + * [Quickstart](#quickstart) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Vmware_engine.create_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js` + + +----- + + + + +### Vmware_engine.create_hcx_activation_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js` + + +----- + + + + +### Vmware_engine.create_network_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js` + + +----- + + + + +### Vmware_engine.create_private_cloud + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js` + + +----- + + + + +### Vmware_engine.create_vmware_engine_network + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js` + + +----- + + + + +### Vmware_engine.delete_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js` + + +----- + + + + +### Vmware_engine.delete_network_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js` + + +----- + + + + +### Vmware_engine.delete_private_cloud + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js` + + +----- + + + + +### Vmware_engine.delete_vmware_engine_network + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js` + + +----- + + + + +### Vmware_engine.get_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js` + + +----- + + + + +### Vmware_engine.get_hcx_activation_key + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js` + + +----- + + + + +### Vmware_engine.get_network_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js` + + +----- + + + + +### Vmware_engine.get_node_type + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js` + + +----- + + + + +### Vmware_engine.get_private_cloud + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js` + + +----- + + + + +### Vmware_engine.get_vmware_engine_network + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js` + + +----- + + + + +### Vmware_engine.list_clusters + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js` + + +----- + + + + +### Vmware_engine.list_hcx_activation_keys + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js` + + +----- + + + + +### Vmware_engine.list_network_policies + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js` + + +----- + + + + +### Vmware_engine.list_node_types + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js` + + +----- + + + + +### Vmware_engine.list_private_clouds + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js` + + +----- + + + + +### Vmware_engine.list_subnets + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js` + + +----- + + + + +### Vmware_engine.list_vmware_engine_networks + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js` + + +----- + + + + +### Vmware_engine.reset_nsx_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js` + + +----- + + + + +### Vmware_engine.reset_vcenter_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js` + + +----- + + + + +### Vmware_engine.show_nsx_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js` + + +----- + + + + +### Vmware_engine.show_vcenter_credentials + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js` + + +----- + + + + +### Vmware_engine.undelete_private_cloud + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js` + + +----- + + + + +### Vmware_engine.update_cluster + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js` + + +----- + + + + +### Vmware_engine.update_network_policy + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js` + + +----- + + + + +### Vmware_engine.update_private_cloud + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js` + + +----- + + + + +### Vmware_engine.update_vmware_engine_network + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/quickstart.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-vmwareengine/samples/test/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-vmwareengine/samples/test/quickstart.js,samples/README.md) + +__Usage:__ + + +`node packages/google-cloud-vmwareengine/samples/test/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md +[product-docs]: cloud.google.com/vmware-engine/ diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json new file mode 100644 index 00000000000..ae6d7d00e9d --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/snippet_metadata.google.cloud.vmwareengine.v1.json @@ -0,0 +1,1491 @@ +{ + "clientLibrary": { + "name": "nodejs-vmwareengine", + "version": "0.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.vmwareengine.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_async", + "title": "VmwareEngine listPrivateClouds Sample", + "origin": "API_DEFINITION", + "description": " Lists `PrivateCloud` resources in a given project and location.", + "canonical": true, + "file": "vmware_engine.list_private_clouds.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 106, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListPrivateClouds", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds", + "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.vmwareengine.v1.ListPrivateCloudsResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListPrivateClouds", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_async", + "title": "VmwareEngine getPrivateCloud Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `PrivateCloud` resource by its resource name.", + "canonical": true, + "file": "vmware_engine.get_private_cloud.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetPrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.PrivateCloud", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetPrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_async", + "title": "VmwareEngine createPrivateCloud Sample", + "origin": "API_DEFINITION", + "description": " Creates a new `PrivateCloud` resource in a given project and location. Private clouds can only be created in zones, regional private clouds are not supported. Creating a private cloud also creates a [management cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) for that private cloud.", + "canonical": true, + "file": "vmware_engine.create_private_cloud.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreatePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "private_cloud_id", + "type": "TYPE_STRING" + }, + { + "name": "private_cloud", + "type": ".google.cloud.vmwareengine.v1.PrivateCloud" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreatePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_async", + "title": "VmwareEngine updatePrivateCloud Sample", + "origin": "API_DEFINITION", + "description": " Modifies a `PrivateCloud` resource. Only the following fields can be updated: `description`. Only fields specified in `updateMask` are applied. During operation processing, the resource is temporarily in the `ACTIVE` state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.", + "canonical": true, + "file": "vmware_engine.update_private_cloud.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdatePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud", + "async": true, + "parameters": [ + { + "name": "private_cloud", + "type": ".google.cloud.vmwareengine.v1.PrivateCloud" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdatePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_async", + "title": "VmwareEngine deletePrivateCloud Sample", + "origin": "API_DEFINITION", + "description": " Schedules a `PrivateCloud` resource for deletion. A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` set to `DELETED` and `expireTime` set to the time when deletion is final and can no longer be reversed. The delete operation is marked as done as soon as the `PrivateCloud` is successfully scheduled for deletion (this also applies when `delayHours` is set to zero), and the operation is not kept in pending state until `PrivateCloud` is purged. `PrivateCloud` can be restored using `UndeletePrivateCloud` method before the `expireTime` elapses. When `expireTime` is reached, deletion is final and all private cloud resources are irreversibly removed and billing stops. During the final removal process, `PrivateCloud.state` is set to `PURGING`. `PrivateCloud` can be polled using standard `GET` method for the whole period of deletion and purging. It will not be returned only when it is completely purged.", + "canonical": true, + "file": "vmware_engine.delete_private_cloud.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeletePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "delay_hours", + "type": "TYPE_INT32" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "DeletePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_async", + "title": "VmwareEngine undeletePrivateCloud Sample", + "origin": "API_DEFINITION", + "description": " Restores a private cloud that was previously scheduled for deletion by `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to the time when deletion can no longer be reversed.", + "canonical": true, + "file": "vmware_engine.undelete_private_cloud.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UndeletePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UndeletePrivateCloud", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListClusters_async", + "title": "VmwareEngine listClusters Sample", + "origin": "API_DEFINITION", + "description": " Lists `Cluster` resources in a given private cloud.", + "canonical": true, + "file": "vmware_engine.list_clusters.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListClusters", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListClusters", + "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.vmwareengine.v1.ListClustersResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListClusters", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListClusters", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetCluster_async", + "title": "VmwareEngine getCluster Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `Cluster` resource by its resource name.", + "canonical": true, + "file": "vmware_engine.get_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.Cluster", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetCluster", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreateCluster_async", + "title": "VmwareEngine createCluster Sample", + "origin": "API_DEFINITION", + "description": " Creates a new cluster in a given private cloud. Creating a new cluster provides additional nodes for use in the parent private cloud and requires sufficient [node quota](https://cloud.google.com/vmware-engine/quotas).", + "canonical": true, + "file": "vmware_engine.create_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 87, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "cluster_id", + "type": "TYPE_STRING" + }, + { + "name": "cluster", + "type": ".google.cloud.vmwareengine.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreateCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdateCluster_async", + "title": "VmwareEngine updateCluster Sample", + "origin": "API_DEFINITION", + "description": " Modifies a `Cluster` resource. Only the following fields can be updated: `node_type_configs.*.node_count`. Only fields specified in `updateMask` are applied. During operation processing, the resource is temporarily in the `ACTIVE` state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.", + "canonical": true, + "file": "vmware_engine.update_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "cluster", + "type": ".google.cloud.vmwareengine.v1.Cluster" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdateCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_DeleteCluster_async", + "title": "VmwareEngine deleteCluster Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `Cluster` resource. To avoid unintended data loss, migrate or gracefully shut down any workloads running on the cluster before deletion. You cannot delete the management cluster of a private cloud using this method.", + "canonical": true, + "file": "vmware_engine.delete_cluster.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "DeleteCluster", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListSubnets_async", + "title": "VmwareEngine listSubnets Sample", + "origin": "API_DEFINITION", + "description": " Lists subnets in a given private cloud.", + "canonical": true, + "file": "vmware_engine.list_subnets.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSubnets", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.ListSubnetsResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListSubnets", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async", + "title": "VmwareEngine listNodeTypes Sample", + "origin": "API_DEFINITION", + "description": " Lists node types", + "canonical": true, + "file": "vmware_engine.list_node_types.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 98, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNodeTypes", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes", + "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" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.ListNodeTypesResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListNodeTypes", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetNodeType_async", + "title": "VmwareEngine getNodeType Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single `NodeType`.", + "canonical": true, + "file": "vmware_engine.get_node_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNodeType", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.NodeType", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetNodeType", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_async", + "title": "VmwareEngine showNsxCredentials Sample", + "origin": "API_DEFINITION", + "description": " Gets details of credentials for NSX appliance.", + "canonical": true, + "file": "vmware_engine.show_nsx_credentials.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ShowNsxCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials", + "async": true, + "parameters": [ + { + "name": "private_cloud", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.Credentials", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ShowNsxCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_async", + "title": "VmwareEngine showVcenterCredentials Sample", + "origin": "API_DEFINITION", + "description": " Gets details of credentials for Vcenter appliance.", + "canonical": true, + "file": "vmware_engine.show_vcenter_credentials.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 58, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ShowVcenterCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials", + "async": true, + "parameters": [ + { + "name": "private_cloud", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.Credentials", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ShowVcenterCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async", + "title": "VmwareEngine resetNsxCredentials Sample", + "origin": "API_DEFINITION", + "description": " Resets credentials of the NSX appliance.", + "canonical": true, + "file": "vmware_engine.reset_nsx_credentials.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResetNsxCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials", + "async": true, + "parameters": [ + { + "name": "private_cloud", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ResetNsxCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async", + "title": "VmwareEngine resetVcenterCredentials Sample", + "origin": "API_DEFINITION", + "description": " Resets credentials of the Vcenter appliance.", + "canonical": true, + "file": "vmware_engine.reset_vcenter_credentials.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ResetVcenterCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials", + "async": true, + "parameters": [ + { + "name": "private_cloud", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ResetVcenterCredentials", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_async", + "title": "VmwareEngine createHcxActivationKey Sample", + "origin": "API_DEFINITION", + "description": " Creates a new HCX activation key in a given private cloud.", + "canonical": true, + "file": "vmware_engine.create_hcx_activation_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 93, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateHcxActivationKey", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "hcx_activation_key", + "type": ".google.cloud.vmwareengine.v1.HcxActivationKey" + }, + { + "name": "hcx_activation_key_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreateHcxActivationKey", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_async", + "title": "VmwareEngine listHcxActivationKeys Sample", + "origin": "API_DEFINITION", + "description": " Lists `HcxActivationKey` resources in a given private cloud.", + "canonical": true, + "file": "vmware_engine.list_hcx_activation_keys.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 75, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListHcxActivationKeys", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListHcxActivationKeys", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_async", + "title": "VmwareEngine getHcxActivationKey Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `HcxActivationKey` resource by its resource name.", + "canonical": true, + "file": "vmware_engine.get_hcx_activation_key.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetHcxActivationKey", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKey", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.HcxActivationKey", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetHcxActivationKey", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKey", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_async", + "title": "VmwareEngine getNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `NetworkPolicy` resource by its resource name.", + "canonical": true, + "file": "vmware_engine.get_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.NetworkPolicy", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_async", + "title": "VmwareEngine listNetworkPolicies Sample", + "origin": "API_DEFINITION", + "description": " Lists `NetworkPolicy` resources in a specified project and location.", + "canonical": true, + "file": "vmware_engine.list_network_policies.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 106, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNetworkPolicies", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies", + "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.vmwareengine.v1.ListNetworkPoliciesResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListNetworkPolicies", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_async", + "title": "VmwareEngine createNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Creates a new network policy in a given VMware Engine network of a project and location (region). A new network policy cannot be created if another network policy already exists in the same scope.", + "canonical": true, + "file": "vmware_engine.create_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "network_policy_id", + "type": "TYPE_STRING" + }, + { + "name": "network_policy", + "type": ".google.cloud.vmwareengine.v1.NetworkPolicy" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreateNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_async", + "title": "VmwareEngine updateNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Modifies a `NetworkPolicy` resource. Only the following fields can be updated: `internet_access`, `external_ip`, `edge_services_cidr`. Only fields specified in `updateMask` are applied. When updating a network policy, the external IP network service can only be disabled if there are no external IP addresses present in the scope of the policy. Also, a `NetworkService` cannot be updated when `NetworkService.state` is set to `RECONCILING`. During operation processing, the resource is temporarily in the `ACTIVE` state before the operation fully completes. For that period of time, you can't update the resource. Use the operation status to determine when the processing fully completes.", + "canonical": true, + "file": "vmware_engine.update_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 78, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "network_policy", + "type": ".google.cloud.vmwareengine.v1.NetworkPolicy" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdateNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_async", + "title": "VmwareEngine deleteNetworkPolicy Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `NetworkPolicy` resource. A network policy cannot be deleted when `NetworkService.state` is set to `RECONCILING` for either its external IP or internet access service.", + "canonical": true, + "file": "vmware_engine.delete_network_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "DeleteNetworkPolicy", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_async", + "title": "VmwareEngine createVmwareEngineNetwork Sample", + "origin": "API_DEFINITION", + "description": " Creates a new VMware Engine network that can be used by a private cloud.", + "canonical": true, + "file": "vmware_engine.create_vmware_engine_network.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 97, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "vmware_engine_network_id", + "type": "TYPE_STRING" + }, + { + "name": "vmware_engine_network", + "type": ".google.cloud.vmwareengine.v1.VmwareEngineNetwork" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "CreateVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_async", + "title": "VmwareEngine updateVmwareEngineNetwork Sample", + "origin": "API_DEFINITION", + "description": " Modifies a VMware Engine network resource. Only the following fields can be updated: `description`. Only fields specified in `updateMask` are applied.", + "canonical": true, + "file": "vmware_engine.update_vmware_engine_network.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork", + "async": true, + "parameters": [ + { + "name": "vmware_engine_network", + "type": ".google.cloud.vmwareengine.v1.VmwareEngineNetwork" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "UpdateVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_async", + "title": "VmwareEngine deleteVmwareEngineNetwork Sample", + "origin": "API_DEFINITION", + "description": " Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware Engine network after all resources that refer to it are deleted. For example, a private cloud, a network peering, and a network policy can all refer to the same VMware Engine network.", + "canonical": true, + "file": "vmware_engine.delete_vmware_engine_network.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "etag", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "DeleteVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_async", + "title": "VmwareEngine getVmwareEngineNetwork Sample", + "origin": "API_DEFINITION", + "description": " Retrieves a `VmwareEngineNetwork` resource by its resource name. The resource contains details of the VMware Engine network, such as its VMware Engine network type, peered networks in a service project, and state (for example, `CREATING`, `ACTIVE`, `DELETING`).", + "canonical": true, + "file": "vmware_engine.get_vmware_engine_network.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.vmwareengine.v1.VmwareEngineNetwork", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "GetVmwareEngineNetwork", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + }, + { + "regionTag": "vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_async", + "title": "VmwareEngine listVmwareEngineNetworks Sample", + "origin": "API_DEFINITION", + "description": " Lists `VmwareEngineNetwork` resources in a given project and location.", + "canonical": true, + "file": "vmware_engine.list_vmware_engine_networks.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 105, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListVmwareEngineNetworks", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks", + "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.vmwareengine.v1.ListVmwareEngineNetworksResponse", + "client": { + "shortName": "VmwareEngineClient", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngineClient" + }, + "method": { + "shortName": "ListVmwareEngineNetworks", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks", + "service": { + "shortName": "VmwareEngine", + "fullName": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + } + } + ] +} \ No newline at end of file diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js new file mode 100644 index 00000000000..2a5295bac1f --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_cluster.js @@ -0,0 +1,95 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, clusterId, cluster) { + // [START vmwareengine_v1_generated_VmwareEngine_CreateCluster_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 resource name of the private cloud to create a new cluster + * in. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const parent = 'abc123' + /** + * Required. The user-provided identifier of the new `Cluster`. + * This identifier must be unique among clusters within the parent and becomes + * the final token in the name URI. + * The identifier must meet the following requirements: + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const clusterId = 'abc123' + /** + * Required. The initial description of the new cluster. + */ + // const cluster = {} + /** + * Optional. 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' + /** + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + */ + // const validateOnly = true + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreateCluster() { + // Construct request + const request = { + parent, + clusterId, + cluster, + }; + + // Run request + const [operation] = await vmwareengineClient.createCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateCluster(); + // [END vmwareengine_v1_generated_VmwareEngine_CreateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js new file mode 100644 index 00000000000..a935cd933ed --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_hcx_activation_key.js @@ -0,0 +1,101 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, hcxActivationKey, hcxActivationKeyId) { + // [START vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_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 resource name of the private cloud to create the key for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + */ + // const parent = 'abc123' + /** + * Required. The initial description of a new HCX activation key. When + * creating a new key, this field must be an empty object. + */ + // const hcxActivationKey = {} + /** + * Required. The user-provided identifier of the `HcxActivationKey` to be + * created. This identifier must be unique among `HcxActivationKey` resources + * within the parent and becomes the final token in the name URI. + * The identifier must meet the following requirements: + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const hcxActivationKeyId = '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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreateHcxActivationKey() { + // Construct request + const request = { + parent, + hcxActivationKey, + hcxActivationKeyId, + }; + + // Run request + const [operation] = await vmwareengineClient.createHcxActivationKey(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateHcxActivationKey(); + // [END vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js new file mode 100644 index 00000000000..eab34fcf936 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_network_policy.js @@ -0,0 +1,102 @@ +// 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, networkPolicyId, networkPolicy) { + // [START vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_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 resource name of the location (region) + * to create the new network policy in. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1` + */ + // const parent = 'abc123' + /** + * Required. The user-provided identifier of the network policy to be created. + * This identifier must be unique within parent + * `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + * the final token in the name URI. + * The identifier must meet the following requirements: + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const networkPolicyId = 'abc123' + /** + * Required. The network policy configuration to use in the request. + */ + // const networkPolicy = {} + /** + * 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreateNetworkPolicy() { + // Construct request + const request = { + parent, + networkPolicyId, + networkPolicy, + }; + + // Run request + const [operation] = await vmwareengineClient.createNetworkPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateNetworkPolicy(); + // [END vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js new file mode 100644 index 00000000000..bc92a9e085e --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_private_cloud.js @@ -0,0 +1,95 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, privateCloudId, privateCloud) { + // [START vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_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 resource name of the location to create the new + * private cloud in. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + */ + // const parent = 'abc123' + /** + * Required. The user-provided identifier of the private cloud to be created. + * This identifier must be unique among each `PrivateCloud` within the parent + * and becomes the final token in the name URI. + * The identifier must meet the following requirements: + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const privateCloudId = 'abc123' + /** + * Required. The initial description of the new private cloud. + */ + // const privateCloud = {} + /** + * Optional. 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' + /** + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + */ + // const validateOnly = true + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreatePrivateCloud() { + // Construct request + const request = { + parent, + privateCloudId, + privateCloud, + }; + + // Run request + const [operation] = await vmwareengineClient.createPrivateCloud(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreatePrivateCloud(); + // [END vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js new file mode 100644 index 00000000000..711698b929a --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.create_vmware_engine_network.js @@ -0,0 +1,105 @@ +// 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, vmwareEngineNetworkId, vmwareEngineNetwork) { + // [START vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_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 resource name of the location to create the new VMware Engine + * network in. A VMware Engine network of type + * `LEGACY` is a regional resource, and a VMware + * Engine network of type `STANDARD` is a global resource. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/global` + */ + // const parent = 'abc123' + /** + * Required. The user-provided identifier of the new VMware Engine network. + * This identifier must be unique among VMware Engine network resources + * within the parent and becomes the final token in the name URI. The + * identifier must meet the following requirements: + * * For networks of type LEGACY, adheres to the format: + * `{region-id}-default`. Replace `{region-id}` with the region where you want + * to create the VMware Engine network. For example, "us-west1-default". + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with RFC 1034 (https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + */ + // const vmwareEngineNetworkId = 'abc123' + /** + * Required. The initial description of the new VMware Engine network. + */ + // const vmwareEngineNetwork = {} + /** + * 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callCreateVmwareEngineNetwork() { + // Construct request + const request = { + parent, + vmwareEngineNetworkId, + vmwareEngineNetwork, + }; + + // Run request + const [operation] = await vmwareengineClient.createVmwareEngineNetwork(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateVmwareEngineNetwork(); + // [END vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js new file mode 100644 index 00000000000..8a9a2e591c9 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_cluster.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmwareengine_v1_generated_VmwareEngine_DeleteCluster_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 resource name of the cluster to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + */ + // const name = 'abc123' + /** + * Optional. 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callDeleteCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.deleteCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteCluster(); + // [END vmwareengine_v1_generated_VmwareEngine_DeleteCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js new file mode 100644 index 00000000000..9046ad7a4f8 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_network_policy.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_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 resource name of the network policy to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + */ + // 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callDeleteNetworkPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.deleteNetworkPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteNetworkPolicy(); + // [END vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.js new file mode 100644 index 00000000000..1b67fd97489 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_private_cloud.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(name) { + // [START vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_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 resource name of the private cloud to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const name = 'abc123' + /** + * Optional. 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' + /** + * Optional. If set to true, cascade delete is enabled and all children of this private + * cloud resource are also deleted. When this flag is set to false, the + * private cloud will not be deleted if there are any children other than the + * management cluster. The management cluster is always deleted. + */ + // const force = true + /** + * Optional. Time delay of the deletion specified in hours. The default value + * is `3`. Specifying a non-zero value for this field changes the value of + * `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + * deletion time. Deletion can be cancelled before `expire_time` elapses using + * VmwareEngine.UndeletePrivateCloud google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud. Specifying a value of `0` for + * this field instead begins the deletion process and ceases billing + * immediately. During the final deletion process, the value of + * `PrivateCloud.state` becomes `PURGING`. + */ + // const delayHours = 1234 + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callDeletePrivateCloud() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.deletePrivateCloud(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeletePrivateCloud(); + // [END vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js new file mode 100644 index 00000000000..af6c1bde29a --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.delete_vmware_engine_network.js @@ -0,0 +1,88 @@ +// 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 vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_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 resource name of the VMware Engine network to be deleted. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + */ + // 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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' + /** + * Optional. Checksum used to ensure that the user-provided value is up to date before + * the server processes the request. The server compares provided checksum + * with the current checksum of the resource. If the user-provided value is + * out of date, this request returns an `ABORTED` error. + */ + // const etag = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callDeleteVmwareEngineNetwork() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.deleteVmwareEngineNetwork(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteVmwareEngineNetwork(); + // [END vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.js new file mode 100644 index 00000000000..cead33460fd --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_cluster.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 vmwareengine_v1_generated_VmwareEngine_GetCluster_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 cluster resource name to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetCluster() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getCluster(request); + console.log(response); + } + + callGetCluster(); + // [END vmwareengine_v1_generated_VmwareEngine_GetCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.js new file mode 100644 index 00000000000..ced65691462 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_hcx_activation_key.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 vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_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 resource name of the HCX activation key to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1/privateClouds/my-cloud/hcxActivationKeys/my-key` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetHcxActivationKey() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getHcxActivationKey(request); + console.log(response); + } + + callGetHcxActivationKey(); + // [END vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.js new file mode 100644 index 00000000000..bc232a3e981 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_network_policy.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 vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_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 resource name of the network policy to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetNetworkPolicy() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getNetworkPolicy(request); + console.log(response); + } + + callGetNetworkPolicy(); + // [END vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.js new file mode 100644 index 00000000000..3e77fbd2045 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_node_type.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 vmwareengine_v1_generated_VmwareEngine_GetNodeType_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 resource name of the node type to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-proj/locations/us-west1-a/nodeTypes/standard-72` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetNodeType() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getNodeType(request); + console.log(response); + } + + callGetNodeType(); + // [END vmwareengine_v1_generated_VmwareEngine_GetNodeType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.js new file mode 100644 index 00000000000..3d9b8fd1c83 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_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 resource name of the private cloud to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetPrivateCloud() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getPrivateCloud(request); + console.log(response); + } + + callGetPrivateCloud(); + // [END vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.js new file mode 100644 index 00000000000..794593a0a4f --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.get_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_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 resource name of the VMware Engine network to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + */ + // const name = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callGetVmwareEngineNetwork() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await vmwareengineClient.getVmwareEngineNetwork(request); + console.log(response); + } + + callGetVmwareEngineNetwork(); + // [END vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js new file mode 100644 index 00000000000..bb2048558c2 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_clusters.js @@ -0,0 +1,104 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListClusters_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 resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const parent = 'abc123' + /** + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListClusters() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listClustersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListClusters(); + // [END vmwareengine_v1_generated_VmwareEngine_ListClusters_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js new file mode 100644 index 00000000000..ca53fac1973 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_hcx_activation_keys.js @@ -0,0 +1,83 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_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 resource name of the private cloud + * to be queried for HCX activation keys. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + */ + // const parent = 'abc123' + /** + * The maximum number of HCX activation keys to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListHcxActivationKeys` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListHcxActivationKeys` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListHcxActivationKeys() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listHcxActivationKeysAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListHcxActivationKeys(); + // [END vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js new file mode 100644 index 00000000000..8c2f591ee32 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_network_policies.js @@ -0,0 +1,114 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_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 resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` + */ + // const parent = 'abc123' + /** + * The maximum number of network policies to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListNetworkPolicies` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListNetworkPolicies` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListNetworkPolicies() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listNetworkPoliciesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNetworkPolicies(); + // [END vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js new file mode 100644 index 00000000000..7a1bb9baa56 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_node_types.js @@ -0,0 +1,106 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_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 resource name of the location to be queried for node types. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + */ + // const parent = 'abc123' + /** + * The maximum number of node types to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListNodeTypes` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "standard-72") + * (virtual_cpu_count > 2) + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") + * ``` + */ + // const filter = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListNodeTypes() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listNodeTypesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListNodeTypes(); + // [END vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js new file mode 100644 index 00000000000..52996077721 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_private_clouds.js @@ -0,0 +1,114 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_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 resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + */ + // const parent = 'abc123' + /** + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListPrivateClouds() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listPrivateCloudsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListPrivateClouds(); + // [END vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js new file mode 100644 index 00000000000..8d40943c2be --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_subnets.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListSubnets_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 resource name of the private cloud to be queried for + * subnets. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const parent = 'abc123' + /** + * The maximum number of subnets to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListSubnetsRequest` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListSubnets() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listSubnetsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSubnets(); + // [END vmwareengine_v1_generated_VmwareEngine_ListSubnets_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js new file mode 100644 index 00000000000..1687f66e6dd --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.list_vmware_engine_networks.js @@ -0,0 +1,113 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_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 resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListVmwareEngineNetworks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listVmwareEngineNetworksAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListVmwareEngineNetworks(); + // [END vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js new file mode 100644 index 00000000000..b4a8c24a9be --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_nsx_credentials.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(privateCloud) { + // [START vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_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 resource name of the private cloud + * to reset credentials for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const privateCloud = '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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callResetNsxCredentials() { + // Construct request + const request = { + privateCloud, + }; + + // Run request + const [operation] = await vmwareengineClient.resetNsxCredentials(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResetNsxCredentials(); + // [END vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js new file mode 100644 index 00000000000..a4a9014dd0a --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.reset_vcenter_credentials.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(privateCloud) { + // [START vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_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 resource name of the private cloud + * to reset credentials for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const privateCloud = '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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callResetVcenterCredentials() { + // Construct request + const request = { + privateCloud, + }; + + // Run request + const [operation] = await vmwareengineClient.resetVcenterCredentials(request); + const [response] = await operation.promise(); + console.log(response); + } + + callResetVcenterCredentials(); + // [END vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.js new file mode 100644 index 00000000000..9781eccfe42 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_nsx_credentials.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(privateCloud) { + // [START vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_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 resource name of the private cloud + * to be queried for credentials. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const privateCloud = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callShowNsxCredentials() { + // Construct request + const request = { + privateCloud, + }; + + // Run request + const response = await vmwareengineClient.showNsxCredentials(request); + console.log(response); + } + + callShowNsxCredentials(); + // [END vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.js new file mode 100644 index 00000000000..c3dc831a563 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.show_vcenter_credentials.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(privateCloud) { + // [START vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_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 resource name of the private cloud + * to be queried for credentials. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const privateCloud = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callShowVcenterCredentials() { + // Construct request + const request = { + privateCloud, + }; + + // Run request + const response = await vmwareengineClient.showVcenterCredentials(request); + console.log(response); + } + + callShowVcenterCredentials(); + // [END vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js new file mode 100644 index 00000000000..773afb94e93 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.undelete_private_cloud.js @@ -0,0 +1,71 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_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 resource name of the private cloud scheduled for deletion. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + */ + // const name = 'abc123' + /** + * Optional. 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUndeletePrivateCloud() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await vmwareengineClient.undeletePrivateCloud(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUndeletePrivateCloud(); + // [END vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js new file mode 100644 index 00000000000..4844b6ba286 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_cluster.js @@ -0,0 +1,81 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, cluster) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdateCluster_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `Cluster` resource by the update. The fields specified in the `updateMask` + * 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 description of the cluster. + */ + // const cluster = {} + /** + * Optional. 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' + /** + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + */ + // const validateOnly = true + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdateCluster() { + // Construct request + const request = { + updateMask, + cluster, + }; + + // Run request + const [operation] = await vmwareengineClient.updateCluster(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateCluster(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdateCluster_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.js new file mode 100644 index 00000000000..c39fa099608 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_network_policy.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(networkPolicy, updateMask) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_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. Network policy description. + */ + // const networkPolicy = {} + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `NetworkPolicy` 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 = {} + /** + * 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdateNetworkPolicy() { + // Construct request + const request = { + networkPolicy, + updateMask, + }; + + // Run request + const [operation] = await vmwareengineClient.updateNetworkPolicy(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateNetworkPolicy(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.js new file mode 100644 index 00000000000..742bca46332 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_private_cloud.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(privateCloud, updateMask) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_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. Private cloud description. + */ + // const privateCloud = {} + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * `PrivateCloud` resource by the update. The fields specified in `updateMask` + * 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 = {} + /** + * Optional. 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdatePrivateCloud() { + // Construct request + const request = { + privateCloud, + updateMask, + }; + + // Run request + const [operation] = await vmwareengineClient.updatePrivateCloud(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdatePrivateCloud(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.js new file mode 100644 index 00000000000..18ee9ff9ff2 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/generated/v1/vmware_engine.update_vmware_engine_network.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(vmwareEngineNetwork, updateMask) { + // [START vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_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. VMware Engine network description. + */ + // const vmwareEngineNetwork = {} + /** + * Required. Field mask is used to specify the fields to be overwritten in the + * VMware Engine network 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. Only the + * following fields can be updated: `description`. + */ + // const updateMask = {} + /** + * 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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * For example, consider a situation where you make an initial request and the + * 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 Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callUpdateVmwareEngineNetwork() { + // Construct request + const request = { + vmwareEngineNetwork, + updateMask, + }; + + // Run request + const [operation] = await vmwareengineClient.updateVmwareEngineNetwork(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateVmwareEngineNetwork(); + // [END vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/package.json b/packages/google-cloud-vmwareengine/samples/package.json new file mode 100644 index 00000000000..712c429f2a3 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/package.json @@ -0,0 +1,24 @@ +{ + "name": "vmwareengine-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12.0.0" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js", + "publish": "echo 'sample test; do not publish'" + }, + "dependencies": { + "@google-cloud/vmwareengine": "0.0.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-vmwareengine/samples/quickstart.js b/packages/google-cloud-vmwareengine/samples/quickstart.js new file mode 100644 index 00000000000..7eb25261c20 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/quickstart.js @@ -0,0 +1,113 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +function main(parent) { + // [START vmwareengine_quickstart] + /** + * 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 resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + */ + // const parent = 'abc123' + /** + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + */ + // const pageSize = 1234 + /** + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + */ + // const filter = 'abc123' + /** + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + */ + // const orderBy = 'abc123' + + // Imports the Vmwareengine library + const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; + + // Instantiates a client + const vmwareengineClient = new VmwareEngineClient(); + + async function callListVmwareEngineNetworks() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await vmwareengineClient.listVmwareEngineNetworksAsync( + request + ); + for await (const response of iterable) { + console.log(response); + } + } + + callListVmwareEngineNetworks(); + // [END vmwareengine_quickstart] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-vmwareengine/samples/test/quickstart.js b/packages/google-cloud-vmwareengine/samples/test/quickstart.js new file mode 100644 index 00000000000..c0c680b8638 --- /dev/null +++ b/packages/google-cloud-vmwareengine/samples/test/quickstart.js @@ -0,0 +1,42 @@ +// 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. + +'use strict'; + +const assert = require('assert'); +const path = require('path'); +const cp = require('child_process'); +const {describe, it, before} = require('mocha'); +const {VmwareEngineClient} = require('@google-cloud/vmwareengine').v1; +const vmwareengineClient = new VmwareEngineClient(); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +describe('Quickstart', () => { + let projectId; + + before(async () => { + projectId = await vmwareengineClient.getProjectId(); + }); + + it('should run quickstart', async () => { + const output = execSync( + `node ./quickstart.js projects/${projectId}/locations/us-central1`, + {cwd} + ); + assert(output !== null); + }); +}); diff --git a/packages/google-cloud-vmwareengine/src/index.ts b/packages/google-cloud-vmwareengine/src/index.ts new file mode 100644 index 00000000000..1eb29bdb169 --- /dev/null +++ b/packages/google-cloud-vmwareengine/src/index.ts @@ -0,0 +1,27 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; + +const VmwareEngineClient = v1.VmwareEngineClient; +type VmwareEngineClient = v1.VmwareEngineClient; + +export {v1, VmwareEngineClient}; +export default {v1, VmwareEngineClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json b/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..14267dd8a24 --- /dev/null +++ b/packages/google-cloud-vmwareengine/src/v1/gapic_metadata.json @@ -0,0 +1,361 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.vmwareengine.v1", + "libraryPackage": "@google-cloud/vmwareengine", + "services": { + "VmwareEngine": { + "clients": { + "grpc": { + "libraryClient": "VmwareEngineClient", + "rpcs": { + "GetPrivateCloud": { + "methods": [ + "getPrivateCloud" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetNodeType": { + "methods": [ + "getNodeType" + ] + }, + "ShowNsxCredentials": { + "methods": [ + "showNsxCredentials" + ] + }, + "ShowVcenterCredentials": { + "methods": [ + "showVcenterCredentials" + ] + }, + "GetHcxActivationKey": { + "methods": [ + "getHcxActivationKey" + ] + }, + "GetNetworkPolicy": { + "methods": [ + "getNetworkPolicy" + ] + }, + "GetVmwareEngineNetwork": { + "methods": [ + "getVmwareEngineNetwork" + ] + }, + "CreatePrivateCloud": { + "methods": [ + "createPrivateCloud" + ] + }, + "UpdatePrivateCloud": { + "methods": [ + "updatePrivateCloud" + ] + }, + "DeletePrivateCloud": { + "methods": [ + "deletePrivateCloud" + ] + }, + "UndeletePrivateCloud": { + "methods": [ + "undeletePrivateCloud" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ResetNsxCredentials": { + "methods": [ + "resetNsxCredentials" + ] + }, + "ResetVcenterCredentials": { + "methods": [ + "resetVcenterCredentials" + ] + }, + "CreateHcxActivationKey": { + "methods": [ + "createHcxActivationKey" + ] + }, + "CreateNetworkPolicy": { + "methods": [ + "createNetworkPolicy" + ] + }, + "UpdateNetworkPolicy": { + "methods": [ + "updateNetworkPolicy" + ] + }, + "DeleteNetworkPolicy": { + "methods": [ + "deleteNetworkPolicy" + ] + }, + "CreateVmwareEngineNetwork": { + "methods": [ + "createVmwareEngineNetwork" + ] + }, + "UpdateVmwareEngineNetwork": { + "methods": [ + "updateVmwareEngineNetwork" + ] + }, + "DeleteVmwareEngineNetwork": { + "methods": [ + "deleteVmwareEngineNetwork" + ] + }, + "ListPrivateClouds": { + "methods": [ + "listPrivateClouds", + "listPrivateCloudsStream", + "listPrivateCloudsAsync" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListSubnets": { + "methods": [ + "listSubnets", + "listSubnetsStream", + "listSubnetsAsync" + ] + }, + "ListNodeTypes": { + "methods": [ + "listNodeTypes", + "listNodeTypesStream", + "listNodeTypesAsync" + ] + }, + "ListHcxActivationKeys": { + "methods": [ + "listHcxActivationKeys", + "listHcxActivationKeysStream", + "listHcxActivationKeysAsync" + ] + }, + "ListNetworkPolicies": { + "methods": [ + "listNetworkPolicies", + "listNetworkPoliciesStream", + "listNetworkPoliciesAsync" + ] + }, + "ListVmwareEngineNetworks": { + "methods": [ + "listVmwareEngineNetworks", + "listVmwareEngineNetworksStream", + "listVmwareEngineNetworksAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "VmwareEngineClient", + "rpcs": { + "GetPrivateCloud": { + "methods": [ + "getPrivateCloud" + ] + }, + "GetCluster": { + "methods": [ + "getCluster" + ] + }, + "GetNodeType": { + "methods": [ + "getNodeType" + ] + }, + "ShowNsxCredentials": { + "methods": [ + "showNsxCredentials" + ] + }, + "ShowVcenterCredentials": { + "methods": [ + "showVcenterCredentials" + ] + }, + "GetHcxActivationKey": { + "methods": [ + "getHcxActivationKey" + ] + }, + "GetNetworkPolicy": { + "methods": [ + "getNetworkPolicy" + ] + }, + "GetVmwareEngineNetwork": { + "methods": [ + "getVmwareEngineNetwork" + ] + }, + "CreatePrivateCloud": { + "methods": [ + "createPrivateCloud" + ] + }, + "UpdatePrivateCloud": { + "methods": [ + "updatePrivateCloud" + ] + }, + "DeletePrivateCloud": { + "methods": [ + "deletePrivateCloud" + ] + }, + "UndeletePrivateCloud": { + "methods": [ + "undeletePrivateCloud" + ] + }, + "CreateCluster": { + "methods": [ + "createCluster" + ] + }, + "UpdateCluster": { + "methods": [ + "updateCluster" + ] + }, + "DeleteCluster": { + "methods": [ + "deleteCluster" + ] + }, + "ResetNsxCredentials": { + "methods": [ + "resetNsxCredentials" + ] + }, + "ResetVcenterCredentials": { + "methods": [ + "resetVcenterCredentials" + ] + }, + "CreateHcxActivationKey": { + "methods": [ + "createHcxActivationKey" + ] + }, + "CreateNetworkPolicy": { + "methods": [ + "createNetworkPolicy" + ] + }, + "UpdateNetworkPolicy": { + "methods": [ + "updateNetworkPolicy" + ] + }, + "DeleteNetworkPolicy": { + "methods": [ + "deleteNetworkPolicy" + ] + }, + "CreateVmwareEngineNetwork": { + "methods": [ + "createVmwareEngineNetwork" + ] + }, + "UpdateVmwareEngineNetwork": { + "methods": [ + "updateVmwareEngineNetwork" + ] + }, + "DeleteVmwareEngineNetwork": { + "methods": [ + "deleteVmwareEngineNetwork" + ] + }, + "ListPrivateClouds": { + "methods": [ + "listPrivateClouds", + "listPrivateCloudsStream", + "listPrivateCloudsAsync" + ] + }, + "ListClusters": { + "methods": [ + "listClusters", + "listClustersStream", + "listClustersAsync" + ] + }, + "ListSubnets": { + "methods": [ + "listSubnets", + "listSubnetsStream", + "listSubnetsAsync" + ] + }, + "ListNodeTypes": { + "methods": [ + "listNodeTypes", + "listNodeTypesStream", + "listNodeTypesAsync" + ] + }, + "ListHcxActivationKeys": { + "methods": [ + "listHcxActivationKeys", + "listHcxActivationKeysStream", + "listHcxActivationKeysAsync" + ] + }, + "ListNetworkPolicies": { + "methods": [ + "listNetworkPolicies", + "listNetworkPoliciesStream", + "listNetworkPoliciesAsync" + ] + }, + "ListVmwareEngineNetworks": { + "methods": [ + "listVmwareEngineNetworks", + "listVmwareEngineNetworksStream", + "listVmwareEngineNetworksAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-vmwareengine/src/v1/index.ts b/packages/google-cloud-vmwareengine/src/v1/index.ts new file mode 100644 index 00000000000..7bb78e0faee --- /dev/null +++ b/packages/google-cloud-vmwareengine/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 {VmwareEngineClient} from './vmware_engine_client'; diff --git a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts new file mode 100644 index 00000000000..f43bfbf4fd9 --- /dev/null +++ b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client.ts @@ -0,0 +1,7031 @@ +// 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, + IamClient, + IamProtos, + LocationsClient, + LocationProtos, +} 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/vmware_engine_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './vmware_engine_client_config.json'; +const version = require('../../../package.json').version; + +/** + * VMwareEngine manages VMware's private clusters in the Cloud. + * @class + * @memberof v1 + */ +export class VmwareEngineClient { + 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}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + vmwareEngineStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of VmwareEngineClient. + * + * @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 VmwareEngineClient({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 VmwareEngineClient; + 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); + + // Request numeric enum values if REST transport is used. + opts.numericEnums = true; + + // 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; + } + this.iamClient = new this._gaxModule.IamClient(this._gaxGrpc, opts); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + // 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 = { + clusterPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}' + ), + hcxActivationKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + networkPolicyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/networkPolicies/{network_policy}' + ), + nodeTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/nodeTypes/{node_type}' + ), + privateCloudPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateClouds/{private_cloud}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + subnetPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}' + ), + vmwareEngineNetworkPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}' + ), + }; + + // 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 = { + listPrivateClouds: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'privateClouds' + ), + listClusters: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'clusters' + ), + listSubnets: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'subnets' + ), + listNodeTypes: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'nodeTypes' + ), + listHcxActivationKeys: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'hcxActivationKeys' + ), + listNetworkPolicies: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'networkPolicies' + ), + listVmwareEngineNetworks: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'vmwareEngineNetworks' + ), + }; + + const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1/{resource=projects/*/locations/*/privateClouds/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1/{resource=projects/*/locations/*/privateClouds/*/clusters/*}:getIamPolicy', + }, + { + get: '/v1/{resource=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/privateClouds/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/privateClouds/*/clusters/*}:setIamPolicy', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/privateClouds/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1/{resource=projects/*/locations/*/privateClouds/*/clusters/*}:testIamPermissions', + body: '*', + }, + { + post: '/v1/{resource=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}:testIamPermissions', + 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 createPrivateCloudResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const createPrivateCloudMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updatePrivateCloudResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const updatePrivateCloudMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deletePrivateCloudResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const deletePrivateCloudMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const undeletePrivateCloudResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const undeletePrivateCloudMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createClusterResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.Cluster' + ) as gax.protobuf.Type; + const createClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateClusterResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.Cluster' + ) as gax.protobuf.Type; + const updateClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteClusterResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteClusterMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const resetNsxCredentialsResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const resetNsxCredentialsMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const resetVcenterCredentialsResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.PrivateCloud' + ) as gax.protobuf.Type; + const resetVcenterCredentialsMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createHcxActivationKeyResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.HcxActivationKey' + ) as gax.protobuf.Type; + const createHcxActivationKeyMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createNetworkPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.NetworkPolicy' + ) as gax.protobuf.Type; + const createNetworkPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateNetworkPolicyResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.NetworkPolicy' + ) as gax.protobuf.Type; + const updateNetworkPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteNetworkPolicyResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteNetworkPolicyMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const createVmwareEngineNetworkResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.VmwareEngineNetwork' + ) as gax.protobuf.Type; + const createVmwareEngineNetworkMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const updateVmwareEngineNetworkResponse = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.VmwareEngineNetwork' + ) as gax.protobuf.Type; + const updateVmwareEngineNetworkMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + const deleteVmwareEngineNetworkResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteVmwareEngineNetworkMetadata = protoFilesRoot.lookup( + '.google.cloud.vmwareengine.v1.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createPrivateCloud: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createPrivateCloudResponse.decode.bind(createPrivateCloudResponse), + createPrivateCloudMetadata.decode.bind(createPrivateCloudMetadata) + ), + updatePrivateCloud: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updatePrivateCloudResponse.decode.bind(updatePrivateCloudResponse), + updatePrivateCloudMetadata.decode.bind(updatePrivateCloudMetadata) + ), + deletePrivateCloud: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deletePrivateCloudResponse.decode.bind(deletePrivateCloudResponse), + deletePrivateCloudMetadata.decode.bind(deletePrivateCloudMetadata) + ), + undeletePrivateCloud: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + undeletePrivateCloudResponse.decode.bind(undeletePrivateCloudResponse), + undeletePrivateCloudMetadata.decode.bind(undeletePrivateCloudMetadata) + ), + createCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createClusterResponse.decode.bind(createClusterResponse), + createClusterMetadata.decode.bind(createClusterMetadata) + ), + updateCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateClusterResponse.decode.bind(updateClusterResponse), + updateClusterMetadata.decode.bind(updateClusterMetadata) + ), + deleteCluster: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteClusterResponse.decode.bind(deleteClusterResponse), + deleteClusterMetadata.decode.bind(deleteClusterMetadata) + ), + resetNsxCredentials: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resetNsxCredentialsResponse.decode.bind(resetNsxCredentialsResponse), + resetNsxCredentialsMetadata.decode.bind(resetNsxCredentialsMetadata) + ), + resetVcenterCredentials: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + resetVcenterCredentialsResponse.decode.bind( + resetVcenterCredentialsResponse + ), + resetVcenterCredentialsMetadata.decode.bind( + resetVcenterCredentialsMetadata + ) + ), + createHcxActivationKey: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createHcxActivationKeyResponse.decode.bind( + createHcxActivationKeyResponse + ), + createHcxActivationKeyMetadata.decode.bind( + createHcxActivationKeyMetadata + ) + ), + createNetworkPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createNetworkPolicyResponse.decode.bind(createNetworkPolicyResponse), + createNetworkPolicyMetadata.decode.bind(createNetworkPolicyMetadata) + ), + updateNetworkPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateNetworkPolicyResponse.decode.bind(updateNetworkPolicyResponse), + updateNetworkPolicyMetadata.decode.bind(updateNetworkPolicyMetadata) + ), + deleteNetworkPolicy: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteNetworkPolicyResponse.decode.bind(deleteNetworkPolicyResponse), + deleteNetworkPolicyMetadata.decode.bind(deleteNetworkPolicyMetadata) + ), + createVmwareEngineNetwork: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createVmwareEngineNetworkResponse.decode.bind( + createVmwareEngineNetworkResponse + ), + createVmwareEngineNetworkMetadata.decode.bind( + createVmwareEngineNetworkMetadata + ) + ), + updateVmwareEngineNetwork: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateVmwareEngineNetworkResponse.decode.bind( + updateVmwareEngineNetworkResponse + ), + updateVmwareEngineNetworkMetadata.decode.bind( + updateVmwareEngineNetworkMetadata + ) + ), + deleteVmwareEngineNetwork: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteVmwareEngineNetworkResponse.decode.bind( + deleteVmwareEngineNetworkResponse + ), + deleteVmwareEngineNetworkMetadata.decode.bind( + deleteVmwareEngineNetworkMetadata + ) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.vmwareengine.v1.VmwareEngine', + 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.vmwareEngineStub) { + return this.vmwareEngineStub; + } + + // Put together the "service stub" for + // google.cloud.vmwareengine.v1.VmwareEngine. + this.vmwareEngineStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.vmwareengine.v1.VmwareEngine' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.vmwareengine.v1.VmwareEngine, + 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 vmwareEngineStubMethods = [ + 'listPrivateClouds', + 'getPrivateCloud', + 'createPrivateCloud', + 'updatePrivateCloud', + 'deletePrivateCloud', + 'undeletePrivateCloud', + 'listClusters', + 'getCluster', + 'createCluster', + 'updateCluster', + 'deleteCluster', + 'listSubnets', + 'listNodeTypes', + 'getNodeType', + 'showNsxCredentials', + 'showVcenterCredentials', + 'resetNsxCredentials', + 'resetVcenterCredentials', + 'createHcxActivationKey', + 'listHcxActivationKeys', + 'getHcxActivationKey', + 'getNetworkPolicy', + 'listNetworkPolicies', + 'createNetworkPolicy', + 'updateNetworkPolicy', + 'deleteNetworkPolicy', + 'createVmwareEngineNetwork', + 'updateVmwareEngineNetwork', + 'deleteVmwareEngineNetwork', + 'getVmwareEngineNetwork', + 'listVmwareEngineNetworks', + ]; + for (const methodName of vmwareEngineStubMethods) { + const callPromise = this.vmwareEngineStub.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.vmwareEngineStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'vmwareengine.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 'vmwareengine.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return ['https://www.googleapis.com/auth/cloud-platform']; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + /** + * Retrieves a `PrivateCloud` resource by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the private cloud to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @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 [PrivateCloud]{@link google.cloud.vmwareengine.v1.PrivateCloud}. + * 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/vmware_engine.get_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_async + */ + getPrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest | undefined, + {} | undefined + ] + >; + getPrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + | protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + | protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getPrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + | protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + | protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IGetPrivateCloudRequest | 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.getPrivateCloud(request, options, callback); + } + /** + * Retrieves a `Cluster` resource by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The cluster resource name to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + * @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 [Cluster]{@link google.cloud.vmwareengine.v1.Cluster}. + * 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/vmware_engine.get_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetCluster_async + */ + getCluster( + request?: protos.google.cloud.vmwareengine.v1.IGetClusterRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IGetClusterRequest | undefined, + {} | undefined + ] + >; + getCluster( + request: protos.google.cloud.vmwareengine.v1.IGetClusterRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IGetClusterRequest | null | undefined, + {} | null | undefined + > + ): void; + getCluster( + request: protos.google.cloud.vmwareengine.v1.IGetClusterRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IGetClusterRequest | null | undefined, + {} | null | undefined + > + ): void; + getCluster( + request?: protos.google.cloud.vmwareengine.v1.IGetClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.ICluster, + | protos.google.cloud.vmwareengine.v1.IGetClusterRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IGetClusterRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IGetClusterRequest | 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.getCluster(request, options, callback); + } + /** + * Gets details of a single `NodeType`. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the node type to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-proj/locations/us-west1-a/nodeTypes/standard-72` + * @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 [NodeType]{@link google.cloud.vmwareengine.v1.NodeType}. + * 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/vmware_engine.get_node_type.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetNodeType_async + */ + getNodeType( + request?: protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INodeType, + protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest | undefined, + {} | undefined + ] + >; + getNodeType( + request: protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.INodeType, + | protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNodeType( + request: protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.INodeType, + | protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNodeType( + request?: protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.INodeType, + | protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.INodeType, + | protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INodeType, + protos.google.cloud.vmwareengine.v1.IGetNodeTypeRequest | 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.getNodeType(request, options, callback); + } + /** + * Gets details of credentials for NSX appliance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.privateCloud + * Required. The resource name of the private cloud + * to be queried for credentials. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @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 [Credentials]{@link google.cloud.vmwareengine.v1.Credentials}. + * 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/vmware_engine.show_nsx_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_async + */ + showNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICredentials, + ( + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | undefined + ), + {} | undefined + ] + >; + showNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + showNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + showNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICredentials, + ( + | protos.google.cloud.vmwareengine.v1.IShowNsxCredentialsRequest + | 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({ + private_cloud: request.privateCloud ?? '', + }); + this.initialize(); + return this.innerApiCalls.showNsxCredentials(request, options, callback); + } + /** + * Gets details of credentials for Vcenter appliance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.privateCloud + * Required. The resource name of the private cloud + * to be queried for credentials. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @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 [Credentials]{@link google.cloud.vmwareengine.v1.Credentials}. + * 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/vmware_engine.show_vcenter_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_async + */ + showVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICredentials, + ( + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | undefined + ), + {} | undefined + ] + >; + showVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + showVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): void; + showVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.ICredentials, + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICredentials, + ( + | protos.google.cloud.vmwareengine.v1.IShowVcenterCredentialsRequest + | 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({ + private_cloud: request.privateCloud ?? '', + }); + this.initialize(); + return this.innerApiCalls.showVcenterCredentials( + request, + options, + callback + ); + } + /** + * Retrieves a `HcxActivationKey` resource by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the HCX activation key to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1/privateClouds/my-cloud/hcxActivationKeys/my-key` + * @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 [HcxActivationKey]{@link google.cloud.vmwareengine.v1.HcxActivationKey}. + * 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/vmware_engine.get_hcx_activation_key.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_async + */ + getHcxActivationKey( + request?: protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + ( + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | undefined + ), + {} | undefined + ] + >; + getHcxActivationKey( + request: protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHcxActivationKey( + request: protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getHcxActivationKey( + request?: protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + ( + | protos.google.cloud.vmwareengine.v1.IGetHcxActivationKeyRequest + | 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.getHcxActivationKey(request, options, callback); + } + /** + * Retrieves a `NetworkPolicy` resource by its resource name. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the network policy to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + * @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 [NetworkPolicy]{@link google.cloud.vmwareengine.v1.NetworkPolicy}. + * 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/vmware_engine.get_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_async + */ + getNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest | undefined, + {} | undefined + ] + >; + getNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + | protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + | protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + | protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + | protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IGetNetworkPolicyRequest | 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.getNetworkPolicy(request, options, callback); + } + /** + * Retrieves a `VmwareEngineNetwork` resource by its resource name. The + * resource contains details of the VMware Engine network, such as its VMware + * Engine network type, peered networks in a service project, and state + * (for example, `CREATING`, `ACTIVE`, `DELETING`). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the VMware Engine network to retrieve. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + * @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 [VmwareEngineNetwork]{@link google.cloud.vmwareengine.v1.VmwareEngineNetwork}. + * 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/vmware_engine.get_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_async + */ + getVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + ( + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | undefined + ), + {} | undefined + ] + >; + getVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, + callback: Callback< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + ( + | protos.google.cloud.vmwareengine.v1.IGetVmwareEngineNetworkRequest + | 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.getVmwareEngineNetwork( + request, + options, + callback + ); + } + + /** + * Creates a new `PrivateCloud` resource in a given project and location. + * Private clouds can only be created in zones, regional private clouds are + * not supported. + * + * Creating a private cloud also creates a [management + * cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) + * for that private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to create the new + * private cloud in. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {string} request.privateCloudId + * Required. The user-provided identifier of the private cloud to be created. + * This identifier must be unique among each `PrivateCloud` within the parent + * and becomes the final token in the name URI. + * The identifier must meet the following requirements: + * + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @param {google.cloud.vmwareengine.v1.PrivateCloud} request.privateCloud + * Required. The initial description of the new private cloud. + * @param {string} [request.requestId] + * Optional. The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + * @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/vmware_engine.create_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_async + */ + createPrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createPrivateCloud( + request: protos.google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateCloud( + request: protos.google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createPrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.ICreatePrivateCloudRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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.createPrivateCloud(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createPrivateCloud()`. + * @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/vmware_engine.create_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_async + */ + async checkCreatePrivateCloudProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.createPrivateCloud, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Modifies a `PrivateCloud` resource. Only the following fields can be + * updated: `description`. + * Only fields specified in `updateMask` are applied. + * + * During operation processing, the resource is temporarily in the `ACTIVE` + * state before the operation fully completes. For that period of time, you + * can't update the resource. Use the operation status to determine when the + * processing fully completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.vmwareengine.v1.PrivateCloud} request.privateCloud + * Required. Private cloud description. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `PrivateCloud` resource by the update. The fields specified in `updateMask` + * 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 {string} [request.requestId] + * Optional. 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/vmware_engine.update_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_async + */ + updatePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updatePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updatePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IUpdatePrivateCloudRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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({ + 'private_cloud.name': request.privateCloud!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updatePrivateCloud(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updatePrivateCloud()`. + * @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/vmware_engine.update_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_async + */ + async checkUpdatePrivateCloudProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.updatePrivateCloud, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Schedules a `PrivateCloud` resource for deletion. + * + * A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` + * set to `DELETED` and `expireTime` set to the time when deletion is final + * and can no longer be reversed. The delete operation is marked as done + * as soon as the `PrivateCloud` is successfully scheduled for deletion + * (this also applies when `delayHours` is set to zero), and the operation is + * not kept in pending state until `PrivateCloud` is purged. + * `PrivateCloud` can be restored using `UndeletePrivateCloud` method before + * the `expireTime` elapses. When `expireTime` is reached, deletion is final + * and all private cloud resources are irreversibly removed and billing stops. + * During the final removal process, `PrivateCloud.state` is set to `PURGING`. + * `PrivateCloud` can be polled using standard `GET` method for the whole + * period of deletion and purging. It will not be returned only + * when it is completely purged. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the private cloud to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {string} [request.requestId] + * Optional. The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.force] + * Optional. If set to true, cascade delete is enabled and all children of this private + * cloud resource are also deleted. When this flag is set to false, the + * private cloud will not be deleted if there are any children other than the + * management cluster. The management cluster is always deleted. + * @param {number} [request.delayHours] + * Optional. Time delay of the deletion specified in hours. The default value + * is `3`. Specifying a non-zero value for this field changes the value of + * `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + * deletion time. Deletion can be cancelled before `expire_time` elapses using + * {@link google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud|VmwareEngine.UndeletePrivateCloud}. Specifying a value of `0` for + * this field instead begins the deletion process and ceases billing + * immediately. During the final deletion process, the value of + * `PrivateCloud.state` becomes `PURGING`. + * @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/vmware_engine.delete_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_async + */ + deletePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deletePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deletePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IDeletePrivateCloudRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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.deletePrivateCloud(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deletePrivateCloud()`. + * @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/vmware_engine.delete_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_async + */ + async checkDeletePrivateCloudProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.deletePrivateCloud, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Restores a private cloud that was previously scheduled for deletion by + * `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has + * `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to + * the time when deletion can no longer be reversed. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the private cloud scheduled for deletion. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {string} [request.requestId] + * Optional. 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/vmware_engine.undelete_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_async + */ + undeletePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + undeletePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeletePrivateCloud( + request: protos.google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + undeletePrivateCloud( + request?: protos.google.cloud.vmwareengine.v1.IUndeletePrivateCloudRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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.undeletePrivateCloud(request, options, callback); + } + /** + * Check the status of the long running operation returned by `undeletePrivateCloud()`. + * @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/vmware_engine.undelete_private_cloud.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_async + */ + async checkUndeletePrivateCloudProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.undeletePrivateCloud, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Creates a new cluster in a given private cloud. + * Creating a new cluster provides additional nodes for + * use in the parent private cloud and requires sufficient [node + * quota](https://cloud.google.com/vmware-engine/quotas). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to create a new cluster + * in. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {string} request.clusterId + * Required. The user-provided identifier of the new `Cluster`. + * This identifier must be unique among clusters within the parent and becomes + * the final token in the name URI. + * The identifier must meet the following requirements: + * + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @param {google.cloud.vmwareengine.v1.Cluster} request.cluster + * Required. The initial description of the new cluster. + * @param {string} [request.requestId] + * Optional. The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + * @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/vmware_engine.create_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateCluster_async + */ + createCluster( + request?: protos.google.cloud.vmwareengine.v1.ICreateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createCluster( + request: protos.google.cloud.vmwareengine.v1.ICreateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request: protos.google.cloud.vmwareengine.v1.ICreateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createCluster( + request?: protos.google.cloud.vmwareengine.v1.ICreateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.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.createCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createCluster()`. + * @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/vmware_engine.create_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateCluster_async + */ + async checkCreateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.Cluster, + protos.google.cloud.vmwareengine.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.createCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.Cluster, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Modifies a `Cluster` resource. Only the following fields can be updated: + * `node_type_configs.*.node_count`. Only fields specified in `updateMask` are + * applied. + * + * During operation processing, the resource is temporarily in the `ACTIVE` + * state before the operation fully completes. For that period of time, you + * can't update the resource. Use the operation status to determine when the + * processing fully completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `Cluster` resource by the update. The fields specified in the `updateMask` + * 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.vmwareengine.v1.Cluster} request.cluster + * Required. The description of the cluster. + * @param {string} [request.requestId] + * Optional. The request ID must be a valid UUID with the exception that + * zero UUID is not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. True if you want the request to be validated and not executed; false + * otherwise. + * @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/vmware_engine.update_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateCluster_async + */ + updateCluster( + request?: protos.google.cloud.vmwareengine.v1.IUpdateClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateCluster( + request: protos.google.cloud.vmwareengine.v1.IUpdateClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request: protos.google.cloud.vmwareengine.v1.IUpdateClusterRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateCluster( + request?: protos.google.cloud.vmwareengine.v1.IUpdateClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.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({ + 'cluster.name': request.cluster!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateCluster()`. + * @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/vmware_engine.update_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateCluster_async + */ + async checkUpdateClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.Cluster, + protos.google.cloud.vmwareengine.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.updateCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.Cluster, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Deletes a `Cluster` resource. To avoid unintended data loss, migrate or + * gracefully shut down any workloads running on the cluster before deletion. + * You cannot delete the management cluster of a private cloud using this + * method. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the cluster to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud/clusters/my-cluster` + * @param {string} [request.requestId] + * Optional. 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/vmware_engine.delete_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteCluster_async + */ + deleteCluster( + request?: protos.google.cloud.vmwareengine.v1.IDeleteClusterRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteCluster( + request: protos.google.cloud.vmwareengine.v1.IDeleteClusterRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request: protos.google.cloud.vmwareengine.v1.IDeleteClusterRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteCluster( + request?: protos.google.cloud.vmwareengine.v1.IDeleteClusterRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.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.deleteCluster(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteCluster()`. + * @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/vmware_engine.delete_cluster.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteCluster_async + */ + async checkDeleteClusterProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.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.deleteCluster, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Resets credentials of the NSX appliance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.privateCloud + * Required. The resource name of the private cloud + * to reset credentials for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.reset_nsx_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async + */ + resetNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resetNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetNsxCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetNsxCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetNsxCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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({ + private_cloud: request.privateCloud ?? '', + }); + this.initialize(); + return this.innerApiCalls.resetNsxCredentials(request, options, callback); + } + /** + * Check the status of the long running operation returned by `resetNsxCredentials()`. + * @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/vmware_engine.reset_nsx_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_async + */ + async checkResetNsxCredentialsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.resetNsxCredentials, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Resets credentials of the Vcenter appliance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.privateCloud + * Required. The resource name of the private cloud + * to reset credentials for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.reset_vcenter_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async + */ + resetVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + resetVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetVcenterCredentials( + request: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + resetVcenterCredentials( + request?: protos.google.cloud.vmwareengine.v1.IResetVcenterCredentialsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.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({ + private_cloud: request.privateCloud ?? '', + }); + this.initialize(); + return this.innerApiCalls.resetVcenterCredentials( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `resetVcenterCredentials()`. + * @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/vmware_engine.reset_vcenter_credentials.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_async + */ + async checkResetVcenterCredentialsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.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.resetVcenterCredentials, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.PrivateCloud, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Creates a new HCX activation key in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to create the key for. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * @param {google.cloud.vmwareengine.v1.HcxActivationKey} request.hcxActivationKey + * Required. The initial description of a new HCX activation key. When + * creating a new key, this field must be an empty object. + * @param {string} request.hcxActivationKeyId + * Required. The user-provided identifier of the `HcxActivationKey` to be + * created. This identifier must be unique among `HcxActivationKey` resources + * within the parent and becomes the final token in the name URI. + * The identifier must meet the following requirements: + * + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.create_hcx_activation_key.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_async + */ + createHcxActivationKey( + request?: protos.google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createHcxActivationKey( + request: protos.google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createHcxActivationKey( + request: protos.google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createHcxActivationKey( + request?: protos.google.cloud.vmwareengine.v1.ICreateHcxActivationKeyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.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.createHcxActivationKey( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createHcxActivationKey()`. + * @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/vmware_engine.create_hcx_activation_key.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_async + */ + async checkCreateHcxActivationKeyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.HcxActivationKey, + protos.google.cloud.vmwareengine.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.createHcxActivationKey, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.HcxActivationKey, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Creates a new network policy in a given VMware Engine network of a + * project and location (region). A new network policy cannot be created if + * another network policy already exists in the same scope. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location (region) + * to create the new network policy in. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1` + * @param {string} request.networkPolicyId + * Required. The user-provided identifier of the network policy to be created. + * This identifier must be unique within parent + * `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + * the final token in the name URI. + * The identifier must meet the following requirements: + * + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @param {google.cloud.vmwareengine.v1.NetworkPolicy} request.networkPolicy + * Required. The network policy configuration to use in the request. + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.create_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_async + */ + createNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.ICreateNetworkPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.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.createNetworkPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createNetworkPolicy()`. + * @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/vmware_engine.create_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_async + */ + async checkCreateNetworkPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.NetworkPolicy, + protos.google.cloud.vmwareengine.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.createNetworkPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.NetworkPolicy, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Modifies a `NetworkPolicy` resource. Only the following fields can be + * updated: `internet_access`, `external_ip`, `edge_services_cidr`. + * Only fields specified in `updateMask` are applied. When updating a network + * policy, the external IP network service can only be disabled if there are + * no external IP addresses present in the scope of the policy. Also, a + * `NetworkService` cannot be updated when `NetworkService.state` is set + * to `RECONCILING`. + * + * During operation processing, the resource is temporarily in the `ACTIVE` + * state before the operation fully completes. For that period of time, you + * can't update the resource. Use the operation status to determine when the + * processing fully completes. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.vmwareengine.v1.NetworkPolicy} request.networkPolicy + * Required. Network policy description. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * `NetworkPolicy` 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 {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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.update_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_async + */ + updateNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IUpdateNetworkPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.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({ + 'network_policy.name': request.networkPolicy!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateNetworkPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateNetworkPolicy()`. + * @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/vmware_engine.update_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_async + */ + async checkUpdateNetworkPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.NetworkPolicy, + protos.google.cloud.vmwareengine.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.updateNetworkPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.NetworkPolicy, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Deletes a `NetworkPolicy` resource. A network policy cannot be deleted + * when `NetworkService.state` is set to `RECONCILING` for either its external + * IP or internet access service. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the network policy to delete. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.delete_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_async + */ + deleteNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteNetworkPolicy( + request: protos.google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteNetworkPolicy( + request?: protos.google.cloud.vmwareengine.v1.IDeleteNetworkPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.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.deleteNetworkPolicy(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteNetworkPolicy()`. + * @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/vmware_engine.delete_network_policy.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_async + */ + async checkDeleteNetworkPolicyProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.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.deleteNetworkPolicy, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Creates a new VMware Engine network that can be used by a private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to create the new VMware Engine + * network in. A VMware Engine network of type + * `LEGACY` is a regional resource, and a VMware + * Engine network of type `STANDARD` is a global resource. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. For example: + * `projects/my-project/locations/global` + * @param {string} request.vmwareEngineNetworkId + * Required. The user-provided identifier of the new VMware Engine network. + * This identifier must be unique among VMware Engine network resources + * within the parent and becomes the final token in the name URI. The + * identifier must meet the following requirements: + * + * * For networks of type LEGACY, adheres to the format: + * `{region-id}-default`. Replace `{region-id}` with the region where you want + * to create the VMware Engine network. For example, "us-west1-default". + * * Only contains 1-63 alphanumeric characters and hyphens + * * Begins with an alphabetical character + * * Ends with a non-hyphen character + * * Not formatted as a UUID + * * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + * (section 3.5) + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} request.vmwareEngineNetwork + * Required. The initial description of the new VMware Engine network. + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.create_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_async + */ + createVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.ICreateVmwareEngineNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.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.createVmwareEngineNetwork( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `createVmwareEngineNetwork()`. + * @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/vmware_engine.create_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_async + */ + async checkCreateVmwareEngineNetworkProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork, + protos.google.cloud.vmwareengine.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.createVmwareEngineNetwork, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Modifies a VMware Engine network resource. Only the following fields can be + * updated: `description`. Only fields specified in `updateMask` are + * applied. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.vmwareengine.v1.VmwareEngineNetwork} request.vmwareEngineNetwork + * Required. VMware Engine network description. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * VMware Engine network 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. Only the + * following fields can be updated: `description`. + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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/vmware_engine.update_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_async + */ + updateVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, + callback: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IUpdateVmwareEngineNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.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({ + 'vmware_engine_network.name': request.vmwareEngineNetwork!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateVmwareEngineNetwork( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `updateVmwareEngineNetwork()`. + * @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/vmware_engine.update_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_async + */ + async checkUpdateVmwareEngineNetworkProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork, + protos.google.cloud.vmwareengine.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.updateVmwareEngineNetwork, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware + * Engine network after all resources that refer to it are deleted. For + * example, a private cloud, a network peering, and a network policy can all + * refer to the same VMware Engine network. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the VMware Engine network to be deleted. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + * @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 guarantees that a + * request doesn't result in creation of duplicate commitments for at least 60 + * minutes. + * + * For example, consider a situation where you make an initial request and the + * 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 {string} [request.etag] + * Optional. Checksum used to ensure that the user-provided value is up to date before + * the server processes the request. The server compares provided checksum + * with the current checksum of the resource. If the user-provided value is + * out of date, this request returns an `ABORTED` error. + * @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/vmware_engine.delete_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_async + */ + deleteVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVmwareEngineNetwork( + request: protos.google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteVmwareEngineNetwork( + request?: protos.google.cloud.vmwareengine.v1.IDeleteVmwareEngineNetworkRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.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.deleteVmwareEngineNetwork( + request, + options, + callback + ); + } + /** + * Check the status of the long running operation returned by `deleteVmwareEngineNetwork()`. + * @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/vmware_engine.delete_vmware_engine_network.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_async + */ + async checkDeleteVmwareEngineNetworkProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.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.deleteVmwareEngineNetwork, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.vmwareengine.v1.OperationMetadata + >; + } + /** + * Lists `PrivateCloud` resources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [PrivateCloud]{@link google.cloud.vmwareengine.v1.PrivateCloud}. + * 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 `listPrivateCloudsAsync()` + * 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. + */ + listPrivateClouds( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud[], + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + ] + >; + listPrivateClouds( + request: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): void; + listPrivateClouds( + request: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): void; + listPrivateClouds( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + | protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IPrivateCloud + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IPrivateCloud[], + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest | null, + protos.google.cloud.vmwareengine.v1.IListPrivateCloudsResponse + ] + > | 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.listPrivateClouds(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 resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [PrivateCloud]{@link google.cloud.vmwareengine.v1.PrivateCloud} 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 `listPrivateCloudsAsync()` + * 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. + */ + listPrivateCloudsStream( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + 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['listPrivateClouds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateClouds.createStream( + this.innerApiCalls.listPrivateClouds as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listPrivateClouds`, 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 resource name of the private cloud to be queried for + * clusters. Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of private clouds to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListPrivateClouds` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListPrivateClouds` must + * match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison operator, and the + * value that you want to use for filtering. The value must be a string, a + * number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + * `<`. + * + * For example, if you are filtering a list of private clouds, you can exclude + * the ones named `example-pc` by specifying `name != "example-pc"`. + * + * You can also filter nested fields. For example, you could specify + * `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + * only if they have a matching address in their network configuration. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-pc") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "private-cloud-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "private-cloud-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 + * [PrivateCloud]{@link google.cloud.vmwareengine.v1.PrivateCloud}. 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/vmware_engine.list_private_clouds.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_async + */ + listPrivateCloudsAsync( + request?: protos.google.cloud.vmwareengine.v1.IListPrivateCloudsRequest, + 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['listPrivateClouds']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listPrivateClouds.asyncIterate( + this.innerApiCalls['listPrivateClouds'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `Cluster` resources in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [Cluster]{@link google.cloud.vmwareengine.v1.Cluster}. + * 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 `listClustersAsync()` + * 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. + */ + listClusters( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster[], + protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, + protos.google.cloud.vmwareengine.v1.IListClustersResponse + ] + >; + listClusters( + request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): void; + listClusters( + request: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): void; + listClusters( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListClustersRequest, + | protos.google.cloud.vmwareengine.v1.IListClustersResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ICluster + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ICluster[], + protos.google.cloud.vmwareengine.v1.IListClustersRequest | null, + protos.google.cloud.vmwareengine.v1.IListClustersResponse + ] + > | 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.listClusters(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 resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [Cluster]{@link google.cloud.vmwareengine.v1.Cluster} 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 `listClustersAsync()` + * 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. + */ + listClustersStream( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.createStream( + this.innerApiCalls.listClusters as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listClusters`, 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 resource name of the private cloud to query for clusters. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of clusters to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListClusters` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to `ListClusters` + * must match the call that provided the page token. + * @param {string} request.filter + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-cluster") + * (nodeCount = "3") + * ``` + * + * By default, each expression is an `AND` expression. However, you can + * include `AND` and `OR` expressions explicitly. For example: + * ``` + * (name = "example-cluster-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-cluster-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results are + * ordered by `name` in ascending order. You can also sort results in + * descending order based on the `name` value using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 + * [Cluster]{@link google.cloud.vmwareengine.v1.Cluster}. 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/vmware_engine.list_clusters.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListClusters_async + */ + listClustersAsync( + request?: protos.google.cloud.vmwareengine.v1.IListClustersRequest, + 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['listClusters']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listClusters.asyncIterate( + this.innerApiCalls['listClusters'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists subnets in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud to be queried for + * subnets. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of subnets to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListSubnetsRequest` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Subnet]{@link google.cloud.vmwareengine.v1.Subnet}. + * 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 `listSubnetsAsync()` + * 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. + */ + listSubnets( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ISubnet[], + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, + protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + ] + >; + listSubnets( + request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ISubnet + > + ): void; + listSubnets( + request: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ISubnet + > + ): void; + listSubnets( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ISubnet + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + | protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.ISubnet + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.ISubnet[], + protos.google.cloud.vmwareengine.v1.IListSubnetsRequest | null, + protos.google.cloud.vmwareengine.v1.IListSubnetsResponse + ] + > | 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.listSubnets(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 resource name of the private cloud to be queried for + * subnets. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of subnets to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListSubnetsRequest` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Subnet]{@link google.cloud.vmwareengine.v1.Subnet} 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 `listSubnetsAsync()` + * 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. + */ + listSubnetsStream( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + 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['listSubnets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubnets.createStream( + this.innerApiCalls.listSubnets as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSubnets`, 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 resource name of the private cloud to be queried for + * subnets. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of subnets to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListSubnetsRequest` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListSubnetsRequest` must match the call that provided the page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Subnet]{@link google.cloud.vmwareengine.v1.Subnet}. 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/vmware_engine.list_subnets.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListSubnets_async + */ + listSubnetsAsync( + request?: protos.google.cloud.vmwareengine.v1.IListSubnetsRequest, + 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['listSubnets']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSubnets.asyncIterate( + this.innerApiCalls['listSubnets'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists node types + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to be queried for node types. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of node types to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNodeTypes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "standard-72") + * (virtual_cpu_count > 2) + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") + * ``` + * @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 [NodeType]{@link google.cloud.vmwareengine.v1.NodeType}. + * 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 `listNodeTypesAsync()` + * 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. + */ + listNodeTypes( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INodeType[], + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + ] + >; + listNodeTypes( + request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INodeType + > + ): void; + listNodeTypes( + request: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INodeType + > + ): void; + listNodeTypes( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INodeType + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + | protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INodeType + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INodeType[], + protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNodeTypesResponse + ] + > | 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.listNodeTypes(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 resource name of the location to be queried for node types. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of node types to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNodeTypes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "standard-72") + * (virtual_cpu_count > 2) + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") + * ``` + * @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 [NodeType]{@link google.cloud.vmwareengine.v1.NodeType} 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 `listNodeTypesAsync()` + * 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. + */ + listNodeTypesStream( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + 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['listNodeTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNodeTypes.createStream( + this.innerApiCalls.listNodeTypes as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNodeTypes`, 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 resource name of the location to be queried for node types. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-west1-a` + * @param {number} request.pageSize + * The maximum number of node types to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNodeTypes` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNodeTypes` must match the call that provided the page token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of node types, you can + * exclude the ones named `standard-72` by specifying + * `name != "standard-72"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "standard-72") + * (virtual_cpu_count > 2) + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "standard-96") AND + * (virtual_cpu_count > 2) OR + * (name = "standard-72") + * ``` + * @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 + * [NodeType]{@link google.cloud.vmwareengine.v1.NodeType}. 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/vmware_engine.list_node_types.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_async + */ + listNodeTypesAsync( + request?: protos.google.cloud.vmwareengine.v1.IListNodeTypesRequest, + 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['listNodeTypes']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNodeTypes.asyncIterate( + this.innerApiCalls['listNodeTypes'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `HcxActivationKey` resources in a given private cloud. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the private cloud + * to be queried for HCX activation keys. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of HCX activation keys to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListHcxActivationKeys` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListHcxActivationKeys` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [HcxActivationKey]{@link google.cloud.vmwareengine.v1.HcxActivationKey}. + * 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 `listHcxActivationKeysAsync()` + * 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. + */ + listHcxActivationKeys( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + ] + >; + listHcxActivationKeys( + request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IHcxActivationKey + > + ): void; + listHcxActivationKeys( + request: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IHcxActivationKey + > + ): void; + listHcxActivationKeys( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IHcxActivationKey + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + | protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IHcxActivationKey + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IHcxActivationKey[], + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest | null, + protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysResponse + ] + > | 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.listHcxActivationKeys(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 resource name of the private cloud + * to be queried for HCX activation keys. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of HCX activation keys to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListHcxActivationKeys` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListHcxActivationKeys` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [HcxActivationKey]{@link google.cloud.vmwareengine.v1.HcxActivationKey} 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 `listHcxActivationKeysAsync()` + * 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. + */ + listHcxActivationKeysStream( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + 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['listHcxActivationKeys']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHcxActivationKeys.createStream( + this.innerApiCalls.listHcxActivationKeys as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listHcxActivationKeys`, 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 resource name of the private cloud + * to be queried for HCX activation keys. + * Resource names are schemeless URIs that follow the conventions in + * https://cloud.google.com/apis/design/resource_names. + * For example: + * `projects/my-project/locations/us-central1/privateClouds/my-cloud` + * @param {number} request.pageSize + * The maximum number of HCX activation keys to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListHcxActivationKeys` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListHcxActivationKeys` must match the call that provided the page + * token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [HcxActivationKey]{@link google.cloud.vmwareengine.v1.HcxActivationKey}. 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/vmware_engine.list_hcx_activation_keys.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_async + */ + listHcxActivationKeysAsync( + request?: protos.google.cloud.vmwareengine.v1.IListHcxActivationKeysRequest, + 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['listHcxActivationKeys']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listHcxActivationKeys.asyncIterate( + this.innerApiCalls['listHcxActivationKeys'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `NetworkPolicy` resources in a specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` + * @param {number} request.pageSize + * The maximum number of network policies to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNetworkPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNetworkPolicies` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [NetworkPolicy]{@link google.cloud.vmwareengine.v1.NetworkPolicy}. + * 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 `listNetworkPoliciesAsync()` + * 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. + */ + listNetworkPolicies( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INetworkPolicy[], + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + ] + >; + listNetworkPolicies( + request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INetworkPolicy + > + ): void; + listNetworkPolicies( + request: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INetworkPolicy + > + ): void; + listNetworkPolicies( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INetworkPolicy + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + | protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.INetworkPolicy + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.INetworkPolicy[], + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest | null, + protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesResponse + ] + > | 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.listNetworkPolicies(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 resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` + * @param {number} request.pageSize + * The maximum number of network policies to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNetworkPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNetworkPolicies` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [NetworkPolicy]{@link google.cloud.vmwareengine.v1.NetworkPolicy} 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 `listNetworkPoliciesAsync()` + * 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. + */ + listNetworkPoliciesStream( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + 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['listNetworkPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNetworkPolicies.createStream( + this.innerApiCalls.listNetworkPolicies as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listNetworkPolicies`, 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 resource name of the location (region) to query for + * network policies. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/us-central1` + * @param {number} request.pageSize + * The maximum number of network policies to return in one page. + * The service may return fewer than this value. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListNetworkPolicies` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListNetworkPolicies` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network policies, you can + * exclude the ones named `example-policy` by specifying + * `name != "example-policy"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-policy") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-policy-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-policy-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 + * [NetworkPolicy]{@link google.cloud.vmwareengine.v1.NetworkPolicy}. 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/vmware_engine.list_network_policies.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_async + */ + listNetworkPoliciesAsync( + request?: protos.google.cloud.vmwareengine.v1.IListNetworkPoliciesRequest, + 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['listNetworkPolicies']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNetworkPolicies.asyncIterate( + this.innerApiCalls['listNetworkPolicies'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists `VmwareEngineNetwork` resources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + * @param {number} request.pageSize + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [VmwareEngineNetwork]{@link google.cloud.vmwareengine.v1.VmwareEngineNetwork}. + * 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 `listVmwareEngineNetworksAsync()` + * 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. + */ + listVmwareEngineNetworks( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + ] + >; + listVmwareEngineNetworks( + request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + > + ): void; + listVmwareEngineNetworks( + request: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + callback: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + > + ): void; + listVmwareEngineNetworks( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + >, + callback?: PaginationCallback< + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + | protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + | null + | undefined, + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork + > + ): Promise< + [ + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[], + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest | null, + protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksResponse + ] + > | 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.listVmwareEngineNetworks( + 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 resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + * @param {number} request.pageSize + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 [VmwareEngineNetwork]{@link google.cloud.vmwareengine.v1.VmwareEngineNetwork} 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 `listVmwareEngineNetworksAsync()` + * 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. + */ + listVmwareEngineNetworksStream( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + 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['listVmwareEngineNetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVmwareEngineNetworks.createStream( + this.innerApiCalls.listVmwareEngineNetworks as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listVmwareEngineNetworks`, 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 resource name of the location to query for + * VMware Engine networks. Resource names are schemeless URIs that follow the + * conventions in https://cloud.google.com/apis/design/resource_names. For + * example: `projects/my-project/locations/global` + * @param {number} request.pageSize + * The maximum number of results to return in one page. + * The maximum value is coerced to 1000. + * The default value of this field is 500. + * @param {string} request.pageToken + * A page token, received from a previous `ListVmwareEngineNetworks` call. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListVmwareEngineNetworks` must match the call that provided the page + * token. + * @param {string} request.filter + * A filter expression that matches resources returned in the response. + * The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. The value + * must be a string, a number, or a boolean. The comparison operator + * must be `=`, `!=`, `>`, or `<`. + * + * For example, if you are filtering a list of network peerings, you can + * exclude the ones named `example-network` by specifying + * `name != "example-network"`. + * + * To filter on multiple expressions, provide each separate expression within + * parentheses. For example: + * ``` + * (name = "example-network") + * (createTime > "2021-04-12T08:15:10.40Z") + * ``` + * + * By default, each expression is an `AND` expression. However, you + * can include `AND` and `OR` expressions explicitly. + * For example: + * ``` + * (name = "example-network-1") AND + * (createTime > "2021-04-12T08:15:10.40Z") OR + * (name = "example-network-2") + * ``` + * @param {string} request.orderBy + * Sorts list results by a certain order. By default, returned results + * are ordered by `name` in ascending order. + * You can also sort results in descending order based on the `name` value + * using `orderBy="name desc"`. + * Currently, only ordering by `name` is supported. + * @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 + * [VmwareEngineNetwork]{@link google.cloud.vmwareengine.v1.VmwareEngineNetwork}. 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/vmware_engine.list_vmware_engine_networks.js + * region_tag:vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_async + */ + listVmwareEngineNetworksAsync( + request?: protos.google.cloud.vmwareengine.v1.IListVmwareEngineNetworksRequest, + 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['listVmwareEngineNetworks']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listVmwareEngineNetworks.asyncIterate( + this.innerApiCalls['listVmwareEngineNetworks'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Gets the access control policy for a resource. Returns an empty policy + * if the resource exists and does not have a policy set. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {Object} [request.options] + * OPTIONAL: A `GetPolicyOptions` object for specifying options to + * `GetIamPolicy`. This field is only used by Cloud IAM. + * + * This object should have the same structure as [GetPolicyOptions]{@link google.iam.v1.GetPolicyOptions} + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [Policy]{@link google.iam.v1.Policy}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Policy]{@link google.iam.v1.Policy}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + getIamPolicy( + request: IamProtos.google.iam.v1.GetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.GetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.getIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + */ + setIamPolicy( + request: IamProtos.google.iam.v1.SetIamPolicyRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.Policy, + IamProtos.google.iam.v1.SetIamPolicyRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.setIamPolicy(request, options, callback); + } + + /** + * Returns permissions that a caller has on the specified resource. If the + * resource does not exist, this will return an empty set of + * permissions, not a NOT_FOUND error. + * + * Note: This operation is designed to be used for building + * permission-aware UIs and command-line tools, not for authorization + * checking. This operation may "fail open" without warning. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * REQUIRED: The resource for which the policy detail is being requested. + * See the operation documentation for the appropriate value for this field. + * @param {string[]} request.permissions + * The set of permissions to check for the `resource`. Permissions with + * wildcards (such as '*' or 'storage.*') are not allowed. For more + * information see + * [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + * @param {Object} [options] + * Optional parameters. You can override the default settings for this call, e.g, timeout, + * retries, paginations, etc. See [gax.CallOptions]{@link https://googleapis.github.io/gax-nodejs/interfaces/CallOptions.html} for the details. + * @param {function(?Error, ?Object)} [callback] + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [TestIamPermissionsResponse]{@link google.iam.v1.TestIamPermissionsResponse}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + */ + testIamPermissions( + request: IamProtos.google.iam.v1.TestIamPermissionsRequest, + options?: + | gax.CallOptions + | Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + IamProtos.google.iam.v1.TestIamPermissionsResponse, + IamProtos.google.iam.v1.TestIamPermissionsRequest | null | undefined, + {} | null | undefined + > + ): Promise { + return this.iamClient.testIamPermissions(request, options, callback); + } + + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @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 [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. 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.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. 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 + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified cluster resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_cloud + * @param {string} cluster + * @returns {string} Resource name string. + */ + clusterPath( + project: string, + location: string, + privateCloud: string, + cluster: string + ) { + return this.pathTemplates.clusterPathTemplate.render({ + project: project, + location: location, + private_cloud: privateCloud, + cluster: cluster, + }); + } + + /** + * Parse the project from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the project. + */ + matchProjectFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).project; + } + + /** + * Parse the location from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the location. + */ + matchLocationFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).location; + } + + /** + * Parse the private_cloud from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the private_cloud. + */ + matchPrivateCloudFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName) + .private_cloud; + } + + /** + * Parse the cluster from Cluster resource. + * + * @param {string} clusterName + * A fully-qualified path representing Cluster resource. + * @returns {string} A string representing the cluster. + */ + matchClusterFromClusterName(clusterName: string) { + return this.pathTemplates.clusterPathTemplate.match(clusterName).cluster; + } + + /** + * Return a fully-qualified hcxActivationKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_cloud + * @param {string} hcx_activation_key + * @returns {string} Resource name string. + */ + hcxActivationKeyPath( + project: string, + location: string, + privateCloud: string, + hcxActivationKey: string + ) { + return this.pathTemplates.hcxActivationKeyPathTemplate.render({ + project: project, + location: location, + private_cloud: privateCloud, + hcx_activation_key: hcxActivationKey, + }); + } + + /** + * Parse the project from HcxActivationKey resource. + * + * @param {string} hcxActivationKeyName + * A fully-qualified path representing HcxActivationKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromHcxActivationKeyName(hcxActivationKeyName: string) { + return this.pathTemplates.hcxActivationKeyPathTemplate.match( + hcxActivationKeyName + ).project; + } + + /** + * Parse the location from HcxActivationKey resource. + * + * @param {string} hcxActivationKeyName + * A fully-qualified path representing HcxActivationKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromHcxActivationKeyName(hcxActivationKeyName: string) { + return this.pathTemplates.hcxActivationKeyPathTemplate.match( + hcxActivationKeyName + ).location; + } + + /** + * Parse the private_cloud from HcxActivationKey resource. + * + * @param {string} hcxActivationKeyName + * A fully-qualified path representing HcxActivationKey resource. + * @returns {string} A string representing the private_cloud. + */ + matchPrivateCloudFromHcxActivationKeyName(hcxActivationKeyName: string) { + return this.pathTemplates.hcxActivationKeyPathTemplate.match( + hcxActivationKeyName + ).private_cloud; + } + + /** + * Parse the hcx_activation_key from HcxActivationKey resource. + * + * @param {string} hcxActivationKeyName + * A fully-qualified path representing HcxActivationKey resource. + * @returns {string} A string representing the hcx_activation_key. + */ + matchHcxActivationKeyFromHcxActivationKeyName(hcxActivationKeyName: string) { + return this.pathTemplates.hcxActivationKeyPathTemplate.match( + hcxActivationKeyName + ).hcx_activation_key; + } + + /** + * 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 networkPolicy resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} network_policy + * @returns {string} Resource name string. + */ + networkPolicyPath(project: string, location: string, networkPolicy: string) { + return this.pathTemplates.networkPolicyPathTemplate.render({ + project: project, + location: location, + network_policy: networkPolicy, + }); + } + + /** + * Parse the project from NetworkPolicy resource. + * + * @param {string} networkPolicyName + * A fully-qualified path representing NetworkPolicy resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNetworkPolicyName(networkPolicyName: string) { + return this.pathTemplates.networkPolicyPathTemplate.match(networkPolicyName) + .project; + } + + /** + * Parse the location from NetworkPolicy resource. + * + * @param {string} networkPolicyName + * A fully-qualified path representing NetworkPolicy resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNetworkPolicyName(networkPolicyName: string) { + return this.pathTemplates.networkPolicyPathTemplate.match(networkPolicyName) + .location; + } + + /** + * Parse the network_policy from NetworkPolicy resource. + * + * @param {string} networkPolicyName + * A fully-qualified path representing NetworkPolicy resource. + * @returns {string} A string representing the network_policy. + */ + matchNetworkPolicyFromNetworkPolicyName(networkPolicyName: string) { + return this.pathTemplates.networkPolicyPathTemplate.match(networkPolicyName) + .network_policy; + } + + /** + * Return a fully-qualified nodeType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} node_type + * @returns {string} Resource name string. + */ + nodeTypePath(project: string, location: string, nodeType: string) { + return this.pathTemplates.nodeTypePathTemplate.render({ + project: project, + location: location, + node_type: nodeType, + }); + } + + /** + * Parse the project from NodeType resource. + * + * @param {string} nodeTypeName + * A fully-qualified path representing NodeType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNodeTypeName(nodeTypeName: string) { + return this.pathTemplates.nodeTypePathTemplate.match(nodeTypeName).project; + } + + /** + * Parse the location from NodeType resource. + * + * @param {string} nodeTypeName + * A fully-qualified path representing NodeType resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNodeTypeName(nodeTypeName: string) { + return this.pathTemplates.nodeTypePathTemplate.match(nodeTypeName).location; + } + + /** + * Parse the node_type from NodeType resource. + * + * @param {string} nodeTypeName + * A fully-qualified path representing NodeType resource. + * @returns {string} A string representing the node_type. + */ + matchNodeTypeFromNodeTypeName(nodeTypeName: string) { + return this.pathTemplates.nodeTypePathTemplate.match(nodeTypeName) + .node_type; + } + + /** + * Return a fully-qualified privateCloud resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_cloud + * @returns {string} Resource name string. + */ + privateCloudPath(project: string, location: string, privateCloud: string) { + return this.pathTemplates.privateCloudPathTemplate.render({ + project: project, + location: location, + private_cloud: privateCloud, + }); + } + + /** + * Parse the project from PrivateCloud resource. + * + * @param {string} privateCloudName + * A fully-qualified path representing PrivateCloud resource. + * @returns {string} A string representing the project. + */ + matchProjectFromPrivateCloudName(privateCloudName: string) { + return this.pathTemplates.privateCloudPathTemplate.match(privateCloudName) + .project; + } + + /** + * Parse the location from PrivateCloud resource. + * + * @param {string} privateCloudName + * A fully-qualified path representing PrivateCloud resource. + * @returns {string} A string representing the location. + */ + matchLocationFromPrivateCloudName(privateCloudName: string) { + return this.pathTemplates.privateCloudPathTemplate.match(privateCloudName) + .location; + } + + /** + * Parse the private_cloud from PrivateCloud resource. + * + * @param {string} privateCloudName + * A fully-qualified path representing PrivateCloud resource. + * @returns {string} A string representing the private_cloud. + */ + matchPrivateCloudFromPrivateCloudName(privateCloudName: string) { + return this.pathTemplates.privateCloudPathTemplate.match(privateCloudName) + .private_cloud; + } + + /** + * 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 subnet resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} private_cloud + * @param {string} subnet + * @returns {string} Resource name string. + */ + subnetPath( + project: string, + location: string, + privateCloud: string, + subnet: string + ) { + return this.pathTemplates.subnetPathTemplate.render({ + project: project, + location: location, + private_cloud: privateCloud, + subnet: subnet, + }); + } + + /** + * Parse the project from Subnet resource. + * + * @param {string} subnetName + * A fully-qualified path representing Subnet resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSubnetName(subnetName: string) { + return this.pathTemplates.subnetPathTemplate.match(subnetName).project; + } + + /** + * Parse the location from Subnet resource. + * + * @param {string} subnetName + * A fully-qualified path representing Subnet resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSubnetName(subnetName: string) { + return this.pathTemplates.subnetPathTemplate.match(subnetName).location; + } + + /** + * Parse the private_cloud from Subnet resource. + * + * @param {string} subnetName + * A fully-qualified path representing Subnet resource. + * @returns {string} A string representing the private_cloud. + */ + matchPrivateCloudFromSubnetName(subnetName: string) { + return this.pathTemplates.subnetPathTemplate.match(subnetName) + .private_cloud; + } + + /** + * Parse the subnet from Subnet resource. + * + * @param {string} subnetName + * A fully-qualified path representing Subnet resource. + * @returns {string} A string representing the subnet. + */ + matchSubnetFromSubnetName(subnetName: string) { + return this.pathTemplates.subnetPathTemplate.match(subnetName).subnet; + } + + /** + * Return a fully-qualified vmwareEngineNetwork resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} vmware_engine_network + * @returns {string} Resource name string. + */ + vmwareEngineNetworkPath( + project: string, + location: string, + vmwareEngineNetwork: string + ) { + return this.pathTemplates.vmwareEngineNetworkPathTemplate.render({ + project: project, + location: location, + vmware_engine_network: vmwareEngineNetwork, + }); + } + + /** + * Parse the project from VmwareEngineNetwork resource. + * + * @param {string} vmwareEngineNetworkName + * A fully-qualified path representing VmwareEngineNetwork resource. + * @returns {string} A string representing the project. + */ + matchProjectFromVmwareEngineNetworkName(vmwareEngineNetworkName: string) { + return this.pathTemplates.vmwareEngineNetworkPathTemplate.match( + vmwareEngineNetworkName + ).project; + } + + /** + * Parse the location from VmwareEngineNetwork resource. + * + * @param {string} vmwareEngineNetworkName + * A fully-qualified path representing VmwareEngineNetwork resource. + * @returns {string} A string representing the location. + */ + matchLocationFromVmwareEngineNetworkName(vmwareEngineNetworkName: string) { + return this.pathTemplates.vmwareEngineNetworkPathTemplate.match( + vmwareEngineNetworkName + ).location; + } + + /** + * Parse the vmware_engine_network from VmwareEngineNetwork resource. + * + * @param {string} vmwareEngineNetworkName + * A fully-qualified path representing VmwareEngineNetwork resource. + * @returns {string} A string representing the vmware_engine_network. + */ + matchVmwareEngineNetworkFromVmwareEngineNetworkName( + vmwareEngineNetworkName: string + ) { + return this.pathTemplates.vmwareEngineNetworkPathTemplate.match( + vmwareEngineNetworkName + ).vmware_engine_network; + } + + /** + * 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.vmwareEngineStub && !this._terminated) { + return this.vmwareEngineStub.then(stub => { + this._terminated = true; + stub.close(); + this.iamClient.close(); + this.locationsClient.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json new file mode 100644 index 00000000000..3629213be22 --- /dev/null +++ b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_client_config.json @@ -0,0 +1,193 @@ +{ + "interfaces": { + "google.cloud.vmwareengine.v1.VmwareEngine": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListPrivateClouds": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetPrivateCloud": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreatePrivateCloud": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdatePrivateCloud": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeletePrivateCloud": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UndeletePrivateCloud": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListClusters": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetCluster": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateCluster": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateCluster": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteCluster": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListSubnets": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListNodeTypes": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetNodeType": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ShowNsxCredentials": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ShowVcenterCredentials": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ResetNsxCredentials": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ResetVcenterCredentials": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateHcxActivationKey": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListHcxActivationKeys": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetHcxActivationKey": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetNetworkPolicy": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListNetworkPolicies": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateNetworkPolicy": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateNetworkPolicy": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteNetworkPolicy": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateVmwareEngineNetwork": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateVmwareEngineNetwork": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteVmwareEngineNetwork": { + "timeout_millis": 120000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetVmwareEngineNetwork": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListVmwareEngineNetworks": { + "timeout_millis": 120000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/packages/google-cloud-vmwareengine/src/v1/vmware_engine_proto_list.json b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_proto_list.json new file mode 100644 index 00000000000..af09633aca9 --- /dev/null +++ b/packages/google-cloud-vmwareengine/src/v1/vmware_engine_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/vmwareengine/v1/vmwareengine.proto" +] diff --git a/packages/google-cloud-vmwareengine/system-test/fixtures/sample/src/index.js b/packages/google-cloud-vmwareengine/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..d5676f8fa54 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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 vmwareengine = require('@google-cloud/vmwareengine'); + +function main() { + const vmwareEngineClient = new vmwareengine.VmwareEngineClient(); +} + +main(); diff --git a/packages/google-cloud-vmwareengine/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-vmwareengine/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..53f33e1e689 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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 {VmwareEngineClient} from '@google-cloud/vmwareengine'; + +// check that the client class type name can be used +function doStuffWithVmwareEngineClient(client: VmwareEngineClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const vmwareEngineClient = new VmwareEngineClient(); + doStuffWithVmwareEngineClient(vmwareEngineClient); +} + +main(); diff --git a/packages/google-cloud-vmwareengine/system-test/install.ts b/packages/google-cloud-vmwareengine/system-test/install.ts new file mode 100644 index 00000000000..6dd1eaadafa --- /dev/null +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/test/gapic_vmware_engine_v1.ts b/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts new file mode 100644 index 00000000000..753c8f794de --- /dev/null +++ b/packages/google-cloud-vmwareengine/test/gapic_vmware_engine_v1.ts @@ -0,0 +1,8208 @@ +// 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 vmwareengineModule from '../src'; + +import {PassThrough} from 'stream'; + +import { + protobuf, + LROperation, + operationsProtos, + IamProtos, + LocationProtos, +} 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.VmwareEngineClient', () => { + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = vmwareengineModule.v1.VmwareEngineClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = vmwareengineModule.v1.VmwareEngineClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = vmwareengineModule.v1.VmwareEngineClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new vmwareengineModule.v1.VmwareEngineClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vmwareEngineStub, undefined); + await client.initialize(); + assert(client.vmwareEngineStub); + }); + + it('has close method for the initialized client', done => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.vmwareEngineStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.vmwareEngineStub, undefined); + client.close().then(() => { + done(); + }); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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 vmwareengineModule.v1.VmwareEngineClient({ + 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('getPrivateCloud', () => { + it('invokes getPrivateCloud without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ); + client.innerApiCalls.getPrivateCloud = stubSimpleCall(expectedResponse); + const [response] = await client.getPrivateCloud(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateCloud without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ); + client.innerApiCalls.getPrivateCloud = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getPrivateCloud( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IPrivateCloud | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateCloud with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getPrivateCloud = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getPrivateCloud(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getPrivateCloud with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetPrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetPrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getPrivateCloud(request), expectedError); + }); + }); + + describe('getCluster', () => { + it('invokes getCluster without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ); + client.innerApiCalls.getCluster = stubSimpleCall(expectedResponse); + const [response] = await client.getCluster(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ); + client.innerApiCalls.getCluster = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getCluster( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ICluster | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getCluster = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getCluster with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getCluster(request), expectedError); + }); + }); + + describe('getNodeType', () => { + it('invokes getNodeType without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNodeTypeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNodeTypeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ); + client.innerApiCalls.getNodeType = stubSimpleCall(expectedResponse); + const [response] = await client.getNodeType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeType without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNodeTypeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNodeTypeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ); + client.innerApiCalls.getNodeType = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNodeType( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.INodeType | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeType with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNodeTypeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNodeTypeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNodeType = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getNodeType(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNodeType as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNodeType with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNodeTypeRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNodeTypeRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNodeType(request), expectedError); + }); + }); + + describe('showNsxCredentials', () => { + it('invokes showNsxCredentials without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Credentials() + ); + client.innerApiCalls.showNsxCredentials = + stubSimpleCall(expectedResponse); + const [response] = await client.showNsxCredentials(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showNsxCredentials without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Credentials() + ); + client.innerApiCalls.showNsxCredentials = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.showNsxCredentials( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ICredentials | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showNsxCredentials with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.showNsxCredentials = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.showNsxCredentials(request), expectedError); + const actualRequest = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showNsxCredentials with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.showNsxCredentials(request), expectedError); + }); + }); + + describe('showVcenterCredentials', () => { + it('invokes showVcenterCredentials without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Credentials() + ); + client.innerApiCalls.showVcenterCredentials = + stubSimpleCall(expectedResponse); + const [response] = await client.showVcenterCredentials(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showVcenterCredentials without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Credentials() + ); + client.innerApiCalls.showVcenterCredentials = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.showVcenterCredentials( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ICredentials | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showVcenterCredentials with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.showVcenterCredentials = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.showVcenterCredentials(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.showVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes showVcenterCredentials with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.showVcenterCredentials(request), + expectedError + ); + }); + }); + + describe('getHcxActivationKey', () => { + it('invokes getHcxActivationKey without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ); + client.innerApiCalls.getHcxActivationKey = + stubSimpleCall(expectedResponse); + const [response] = await client.getHcxActivationKey(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHcxActivationKey without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ); + client.innerApiCalls.getHcxActivationKey = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getHcxActivationKey( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IHcxActivationKey | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHcxActivationKey with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getHcxActivationKey = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getHcxActivationKey(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getHcxActivationKey with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getHcxActivationKey(request), expectedError); + }); + }); + + describe('getNetworkPolicy', () => { + it('invokes getNetworkPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ); + client.innerApiCalls.getNetworkPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.getNetworkPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNetworkPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ); + client.innerApiCalls.getNetworkPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getNetworkPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.INetworkPolicy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNetworkPolicy with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getNetworkPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getNetworkPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getNetworkPolicy with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getNetworkPolicy(request), expectedError); + }); + }); + + describe('getVmwareEngineNetwork', () => { + it('invokes getVmwareEngineNetwork without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ); + client.innerApiCalls.getVmwareEngineNetwork = + stubSimpleCall(expectedResponse); + const [response] = await client.getVmwareEngineNetwork(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVmwareEngineNetwork without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ); + client.innerApiCalls.getVmwareEngineNetwork = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getVmwareEngineNetwork( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVmwareEngineNetwork with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getVmwareEngineNetwork = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getVmwareEngineNetwork(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getVmwareEngineNetwork with closed client', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects( + client.getVmwareEngineNetwork(request), + expectedError + ); + }); + }); + + describe('createPrivateCloud', () => { + it('invokes createPrivateCloud without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateCloud = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createPrivateCloud(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateCloud without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createPrivateCloud = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createPrivateCloud( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateCloud with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateCloud = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createPrivateCloud(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createPrivateCloud with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createPrivateCloud = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createPrivateCloud(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createPrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreatePrivateCloudProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreatePrivateCloudProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreatePrivateCloudProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreatePrivateCloudProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updatePrivateCloud', () => { + it('invokes updatePrivateCloud without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest() + ); + request.privateCloud ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest', + ['privateCloud', 'name'] + ); + request.privateCloud.name = defaultValue1; + const expectedHeaderRequestParams = `private_cloud.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePrivateCloud = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updatePrivateCloud(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateCloud without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest() + ); + request.privateCloud ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest', + ['privateCloud', 'name'] + ); + request.privateCloud.name = defaultValue1; + const expectedHeaderRequestParams = `private_cloud.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updatePrivateCloud = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updatePrivateCloud( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateCloud with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest() + ); + request.privateCloud ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest', + ['privateCloud', 'name'] + ); + request.privateCloud.name = defaultValue1; + const expectedHeaderRequestParams = `private_cloud.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePrivateCloud = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updatePrivateCloud(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updatePrivateCloud with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest() + ); + request.privateCloud ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest', + ['privateCloud', 'name'] + ); + request.privateCloud.name = defaultValue1; + const expectedHeaderRequestParams = `private_cloud.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updatePrivateCloud = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updatePrivateCloud(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updatePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdatePrivateCloudProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdatePrivateCloudProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdatePrivateCloudProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdatePrivateCloudProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deletePrivateCloud', () => { + it('invokes deletePrivateCloud without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateCloud = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deletePrivateCloud(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateCloud without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deletePrivateCloud = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deletePrivateCloud( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateCloud with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateCloud = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deletePrivateCloud(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deletePrivateCloud with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deletePrivateCloud = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deletePrivateCloud(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeletePrivateCloudProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeletePrivateCloudProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeletePrivateCloudProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeletePrivateCloudProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('undeletePrivateCloud', () => { + it('invokes undeletePrivateCloud without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePrivateCloud = + stubLongRunningCall(expectedResponse); + const [operation] = await client.undeletePrivateCloud(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePrivateCloud without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.undeletePrivateCloud = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.undeletePrivateCloud( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePrivateCloud with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePrivateCloud = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.undeletePrivateCloud(request), expectedError); + const actualRequest = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes undeletePrivateCloud with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.undeletePrivateCloud = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.undeletePrivateCloud(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.undeletePrivateCloud as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUndeletePrivateCloudProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUndeletePrivateCloudProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUndeletePrivateCloudProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUndeletePrivateCloudProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createCluster', () => { + it('invokes createCluster without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createCluster with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateClusterRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateClusterProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateClusterProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateCluster', () => { + it('invokes updateCluster without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.ICluster, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateCluster with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateClusterRequest() + ); + request.cluster ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateClusterRequest', + ['cluster', 'name'] + ); + request.cluster.name = defaultValue1; + const expectedHeaderRequestParams = `cluster.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateClusterProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateClusterProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteCluster', () => { + it('invokes deleteCluster without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteCluster(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteCluster = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteCluster( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCluster(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteCluster with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteClusterRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteClusterRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCluster = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteCluster(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteCluster as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteClusterProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteClusterProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteClusterProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteClusterProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resetNsxCredentials', () => { + it('invokes resetNsxCredentials without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetNsxCredentials = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resetNsxCredentials(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetNsxCredentials = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resetNsxCredentials( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.resetNsxCredentials(request), expectedError); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetNsxCredentials with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetNsxCredentials = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resetNsxCredentials(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetNsxCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResetNsxCredentialsProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetNsxCredentialsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResetNsxCredentialsProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetNsxCredentialsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('resetVcenterCredentials', () => { + it('invokes resetVcenterCredentials without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetVcenterCredentials = + stubLongRunningCall(expectedResponse); + const [operation] = await client.resetVcenterCredentials(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetVcenterCredentials without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.resetVcenterCredentials = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.resetVcenterCredentials( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IPrivateCloud, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetVcenterCredentials with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetVcenterCredentials = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.resetVcenterCredentials(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes resetVcenterCredentials with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest', + ['privateCloud'] + ); + request.privateCloud = defaultValue1; + const expectedHeaderRequestParams = `private_cloud=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.resetVcenterCredentials = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.resetVcenterCredentials(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.resetVcenterCredentials as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkResetVcenterCredentialsProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetVcenterCredentialsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkResetVcenterCredentialsProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkResetVcenterCredentialsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createHcxActivationKey', () => { + it('invokes createHcxActivationKey without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createHcxActivationKey = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createHcxActivationKey(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHcxActivationKey without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createHcxActivationKey = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createHcxActivationKey( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IHcxActivationKey, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHcxActivationKey with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHcxActivationKey = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createHcxActivationKey(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createHcxActivationKey with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createHcxActivationKey = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createHcxActivationKey(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createHcxActivationKey as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateHcxActivationKeyProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateHcxActivationKeyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateHcxActivationKeyProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateHcxActivationKeyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createNetworkPolicy', () => { + it('invokes createNetworkPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNetworkPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createNetworkPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNetworkPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createNetworkPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createNetworkPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNetworkPolicy with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNetworkPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createNetworkPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createNetworkPolicy with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createNetworkPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createNetworkPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateNetworkPolicyProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateNetworkPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateNetworkPolicyProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateNetworkPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateNetworkPolicy', () => { + it('invokes updateNetworkPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest() + ); + request.networkPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest', + ['networkPolicy', 'name'] + ); + request.networkPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `network_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateNetworkPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateNetworkPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNetworkPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest() + ); + request.networkPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest', + ['networkPolicy', 'name'] + ); + request.networkPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `network_policy.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateNetworkPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateNetworkPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.INetworkPolicy, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNetworkPolicy with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest() + ); + request.networkPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest', + ['networkPolicy', 'name'] + ); + request.networkPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `network_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNetworkPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateNetworkPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateNetworkPolicy with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest() + ); + request.networkPolicy ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest', + ['networkPolicy', 'name'] + ); + request.networkPolicy.name = defaultValue1; + const expectedHeaderRequestParams = `network_policy.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateNetworkPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateNetworkPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateNetworkPolicyProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateNetworkPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateNetworkPolicyProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateNetworkPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteNetworkPolicy', () => { + it('invokes deleteNetworkPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNetworkPolicy = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteNetworkPolicy(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNetworkPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteNetworkPolicy = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteNetworkPolicy( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNetworkPolicy with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNetworkPolicy = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteNetworkPolicy(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteNetworkPolicy with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteNetworkPolicy = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteNetworkPolicy(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteNetworkPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteNetworkPolicyProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteNetworkPolicyProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteNetworkPolicyProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteNetworkPolicyProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createVmwareEngineNetwork', () => { + it('invokes createVmwareEngineNetwork without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVmwareEngineNetwork = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createVmwareEngineNetwork(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVmwareEngineNetwork without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createVmwareEngineNetwork = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createVmwareEngineNetwork( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVmwareEngineNetwork with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVmwareEngineNetwork = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.createVmwareEngineNetwork(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createVmwareEngineNetwork with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createVmwareEngineNetwork = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createVmwareEngineNetwork(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateVmwareEngineNetworkProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateVmwareEngineNetworkProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateVmwareEngineNetworkProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkCreateVmwareEngineNetworkProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateVmwareEngineNetwork', () => { + it('invokes updateVmwareEngineNetwork without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest() + ); + request.vmwareEngineNetwork ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest', + ['vmwareEngineNetwork', 'name'] + ); + request.vmwareEngineNetwork.name = defaultValue1; + const expectedHeaderRequestParams = `vmware_engine_network.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateVmwareEngineNetwork = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateVmwareEngineNetwork(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVmwareEngineNetwork without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest() + ); + request.vmwareEngineNetwork ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest', + ['vmwareEngineNetwork', 'name'] + ); + request.vmwareEngineNetwork.name = defaultValue1; + const expectedHeaderRequestParams = `vmware_engine_network.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateVmwareEngineNetwork = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateVmwareEngineNetwork( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVmwareEngineNetwork with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest() + ); + request.vmwareEngineNetwork ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest', + ['vmwareEngineNetwork', 'name'] + ); + request.vmwareEngineNetwork.name = defaultValue1; + const expectedHeaderRequestParams = `vmware_engine_network.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVmwareEngineNetwork = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateVmwareEngineNetwork(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateVmwareEngineNetwork with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest() + ); + request.vmwareEngineNetwork ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest', + ['vmwareEngineNetwork', 'name'] + ); + request.vmwareEngineNetwork.name = defaultValue1; + const expectedHeaderRequestParams = `vmware_engine_network.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateVmwareEngineNetwork = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateVmwareEngineNetwork(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateVmwareEngineNetworkProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateVmwareEngineNetworkProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateVmwareEngineNetworkProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkUpdateVmwareEngineNetworkProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteVmwareEngineNetwork', () => { + it('invokes deleteVmwareEngineNetwork without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVmwareEngineNetwork = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteVmwareEngineNetwork(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVmwareEngineNetwork without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteVmwareEngineNetwork = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteVmwareEngineNetwork( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.vmwareengine.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVmwareEngineNetwork with call error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVmwareEngineNetwork = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteVmwareEngineNetwork(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteVmwareEngineNetwork with LRO error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteVmwareEngineNetwork = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteVmwareEngineNetwork(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteVmwareEngineNetwork as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteVmwareEngineNetworkProgress without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteVmwareEngineNetworkProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteVmwareEngineNetworkProgress with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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.checkDeleteVmwareEngineNetworkProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listPrivateClouds', () => { + it('invokes listPrivateClouds without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.innerApiCalls.listPrivateClouds = stubSimpleCall(expectedResponse); + const [response] = await client.listPrivateClouds(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateClouds without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.innerApiCalls.listPrivateClouds = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listPrivateClouds( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateClouds with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listPrivateClouds = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listPrivateClouds(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listPrivateClouds as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listPrivateCloudsStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.descriptors.page.listPrivateClouds.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listPrivateCloudsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + 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.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateClouds, request) + ); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listPrivateCloudsStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateClouds.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listPrivateCloudsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.PrivateCloud[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.PrivateCloud) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listPrivateClouds, request) + ); + assert( + (client.descriptors.page.listPrivateClouds.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateClouds without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.PrivateCloud() + ), + ]; + client.descriptors.page.listPrivateClouds.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = []; + const iterable = client.listPrivateCloudsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listPrivateClouds with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listPrivateClouds.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listPrivateCloudsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.IPrivateCloud[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listPrivateClouds.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listClusters', () => { + it('invokes listClusters without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = stubSimpleCall(expectedResponse); + const [response] = await client.listClusters(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.innerApiCalls.listClusters = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listClusters( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ICluster[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClusters with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listClusters = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listClusters(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listClusters as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listClustersStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + 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.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listClustersStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listClustersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Cluster[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Cluster) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listClusters, request) + ); + assert( + (client.descriptors.page.listClusters.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.Cluster() + ), + ]; + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; + const iterable = client.listClustersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listClusters with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListClustersRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListClustersRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listClusters.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listClustersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.ICluster[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listClusters.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listClusters.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSubnets', () => { + it('invokes listSubnets without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.innerApiCalls.listSubnets = stubSimpleCall(expectedResponse); + const [response] = await client.listSubnets(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubnets without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.innerApiCalls.listSubnets = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSubnets( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.ISubnet[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubnets with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSubnets = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSubnets(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSubnets as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSubnetsStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.descriptors.page.listSubnets.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSubnetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Subnet) => { + 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.listSubnets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubnets, request) + ); + assert( + (client.descriptors.page.listSubnets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSubnetsStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubnets.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSubnetsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.Subnet[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.Subnet) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSubnets.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSubnets, request) + ); + assert( + (client.descriptors.page.listSubnets.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubnets without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + generateSampleMessage(new protos.google.cloud.vmwareengine.v1.Subnet()), + ]; + client.descriptors.page.listSubnets.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; + const iterable = client.listSubnetsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSubnets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSubnets with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListSubnetsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListSubnetsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSubnets.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSubnetsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.ISubnet[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSubnets.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listSubnets.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNodeTypes', () => { + it('invokes listNodeTypes without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + ]; + client.innerApiCalls.listNodeTypes = stubSimpleCall(expectedResponse); + const [response] = await client.listNodeTypes(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodeTypes without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + ]; + client.innerApiCalls.listNodeTypes = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNodeTypes( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.INodeType[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodeTypes with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNodeTypes = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNodeTypes(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNodeTypes as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNodeTypesStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + ]; + client.descriptors.page.listNodeTypes.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNodeTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.NodeType) => { + 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.listNodeTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodeTypes, request) + ); + assert( + (client.descriptors.page.listNodeTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNodeTypesStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNodeTypes.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNodeTypesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.NodeType[] = []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.NodeType) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNodeTypes.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNodeTypes, request) + ); + assert( + (client.descriptors.page.listNodeTypes.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNodeTypes without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NodeType() + ), + ]; + client.descriptors.page.listNodeTypes.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; + const iterable = client.listNodeTypesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNodeTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNodeTypes with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNodeTypesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNodeTypesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNodeTypes.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNodeTypesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.INodeType[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNodeTypes.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNodeTypes.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listHcxActivationKeys', () => { + it('invokes listHcxActivationKeys without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + ]; + client.innerApiCalls.listHcxActivationKeys = + stubSimpleCall(expectedResponse); + const [response] = await client.listHcxActivationKeys(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHcxActivationKeys without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + ]; + client.innerApiCalls.listHcxActivationKeys = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listHcxActivationKeys( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHcxActivationKeys with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listHcxActivationKeys = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listHcxActivationKeys(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listHcxActivationKeys as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listHcxActivationKeysStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + ]; + client.descriptors.page.listHcxActivationKeys.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listHcxActivationKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { + 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.listHcxActivationKeys + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listHcxActivationKeys, request) + ); + assert( + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listHcxActivationKeysStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHcxActivationKeys.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listHcxActivationKeysStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.HcxActivationKey[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.HcxActivationKey) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listHcxActivationKeys, request) + ); + assert( + ( + client.descriptors.page.listHcxActivationKeys + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHcxActivationKeys without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.HcxActivationKey() + ), + ]; + client.descriptors.page.listHcxActivationKeys.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + []; + const iterable = client.listHcxActivationKeysAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listHcxActivationKeys with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listHcxActivationKeys.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listHcxActivationKeysAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.IHcxActivationKey[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listHcxActivationKeys + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listNetworkPolicies', () => { + it('invokes listNetworkPolicies without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + ]; + client.innerApiCalls.listNetworkPolicies = + stubSimpleCall(expectedResponse); + const [response] = await client.listNetworkPolicies(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNetworkPolicies without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + ]; + client.innerApiCalls.listNetworkPolicies = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNetworkPolicies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNetworkPolicies with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listNetworkPolicies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNetworkPolicies(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNetworkPolicies as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listNetworkPoliciesStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + ]; + client.descriptors.page.listNetworkPolicies.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNetworkPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { + 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.listNetworkPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkPolicies, request) + ); + assert( + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listNetworkPoliciesStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkPolicies.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNetworkPoliciesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.NetworkPolicy[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.vmwareengine.v1.NetworkPolicy) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNetworkPolicies, request) + ); + assert( + (client.descriptors.page.listNetworkPolicies.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNetworkPolicies without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.NetworkPolicy() + ), + ]; + client.descriptors.page.listNetworkPolicies.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + []; + const iterable = client.listNetworkPoliciesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listNetworkPolicies with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listNetworkPolicies.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNetworkPoliciesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.INetworkPolicy[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listNetworkPolicies.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listVmwareEngineNetworks', () => { + it('invokes listVmwareEngineNetworks without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + ]; + client.innerApiCalls.listVmwareEngineNetworks = + stubSimpleCall(expectedResponse); + const [response] = await client.listVmwareEngineNetworks(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVmwareEngineNetworks without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + ]; + client.innerApiCalls.listVmwareEngineNetworks = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVmwareEngineNetworks( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVmwareEngineNetworks with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listVmwareEngineNetworks = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listVmwareEngineNetworks(request), + expectedError + ); + const actualRequest = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listVmwareEngineNetworks as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listVmwareEngineNetworksStream without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + ]; + client.descriptors.page.listVmwareEngineNetworks.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listVmwareEngineNetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork + ) => { + 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.listVmwareEngineNetworks + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) + ); + assert( + ( + client.descriptors.page.listVmwareEngineNetworks + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listVmwareEngineNetworksStream with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVmwareEngineNetworks.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listVmwareEngineNetworksStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork[] = + []; + stream.on( + 'data', + ( + response: protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listVmwareEngineNetworks + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listVmwareEngineNetworks, request) + ); + assert( + ( + client.descriptors.page.listVmwareEngineNetworks + .createStream as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVmwareEngineNetworks without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.VmwareEngineNetwork() + ), + ]; + client.descriptors.page.listVmwareEngineNetworks.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = + []; + const iterable = client.listVmwareEngineNetworksAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listVmwareEngineNetworks + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVmwareEngineNetworks + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listVmwareEngineNetworks with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listVmwareEngineNetworks.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listVmwareEngineNetworksAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.vmwareengine.v1.IVmwareEngineNetwork[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listVmwareEngineNetworks + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.descriptors.page.listVmwareEngineNetworks + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getIamPolicy', () => { + it('invokes getIamPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.getIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getIamPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.getIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.getIamPolicy as SinonStub).getCall(0)); + }); + it('invokes getIamPolicy with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.GetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.getIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.getIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.getIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('setIamPolicy', () => { + it('invokes setIamPolicy without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = stubSimpleCall(expectedResponse); + const response = await client.setIamPolicy(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes setIamPolicy without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.Policy() + ); + client.iamClient.setIamPolicy = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.setIamPolicy( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.Policy | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.setIamPolicy as SinonStub).getCall(0)); + }); + it('invokes setIamPolicy with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.SetIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.setIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects( + client.setIamPolicy(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.setIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('testIamPermissions', () => { + it('invokes testIamPermissions without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = stubSimpleCall(expectedResponse); + const response = await client.testIamPermissions( + request, + expectedOptions + ); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes testIamPermissions without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsResponse() + ); + client.iamClient.testIamPermissions = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.testIamPermissions( + request, + expectedOptions, + ( + err?: Error | null, + result?: IamProtos.google.iam.v1.TestIamPermissionsResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.iamClient.testIamPermissions as SinonStub).getCall(0)); + }); + it('invokes testIamPermissions with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new IamProtos.google.iam.v1.TestIamPermissionsRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.iamClient.testIamPermissions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.testIamPermissions(request, expectedOptions), + expectedError + ); + assert( + (client.iamClient.testIamPermissions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + it('invokes getLocation without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + it('invokes getOperation with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.cancelOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); + }); + it('invokes cancelOperation with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.cancelOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes deleteOperation without error using callback', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); + assert( + (client.operationsClient.deleteOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedResponse = [ + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsResponse() + ), + ]; + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + it('uses async iteration with listOperations with error', async () => { + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.ListOperationsRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); + await assert.rejects(async () => { + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + }); + }); + + describe('Path templates', () => { + describe('cluster', () => { + const fakePath = '/rendered/path/cluster'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_cloud: 'privateCloudValue', + cluster: 'clusterValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.clusterPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.clusterPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('clusterPath', () => { + const result = client.clusterPath( + 'projectValue', + 'locationValue', + 'privateCloudValue', + 'clusterValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.clusterPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromClusterName', () => { + const result = client.matchProjectFromClusterName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromClusterName', () => { + const result = client.matchLocationFromClusterName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateCloudFromClusterName', () => { + const result = client.matchPrivateCloudFromClusterName(fakePath); + assert.strictEqual(result, 'privateCloudValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchClusterFromClusterName', () => { + const result = client.matchClusterFromClusterName(fakePath); + assert.strictEqual(result, 'clusterValue'); + assert( + (client.pathTemplates.clusterPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('hcxActivationKey', () => { + const fakePath = '/rendered/path/hcxActivationKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_cloud: 'privateCloudValue', + hcx_activation_key: 'hcxActivationKeyValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.hcxActivationKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.hcxActivationKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('hcxActivationKeyPath', () => { + const result = client.hcxActivationKeyPath( + 'projectValue', + 'locationValue', + 'privateCloudValue', + 'hcxActivationKeyValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.hcxActivationKeyPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromHcxActivationKeyName', () => { + const result = client.matchProjectFromHcxActivationKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.hcxActivationKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromHcxActivationKeyName', () => { + const result = client.matchLocationFromHcxActivationKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.hcxActivationKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateCloudFromHcxActivationKeyName', () => { + const result = + client.matchPrivateCloudFromHcxActivationKeyName(fakePath); + assert.strictEqual(result, 'privateCloudValue'); + assert( + (client.pathTemplates.hcxActivationKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchHcxActivationKeyFromHcxActivationKeyName', () => { + const result = + client.matchHcxActivationKeyFromHcxActivationKeyName(fakePath); + assert.strictEqual(result, 'hcxActivationKeyValue'); + assert( + (client.pathTemplates.hcxActivationKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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('networkPolicy', () => { + const fakePath = '/rendered/path/networkPolicy'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + network_policy: 'networkPolicyValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.networkPolicyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.networkPolicyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('networkPolicyPath', () => { + const result = client.networkPolicyPath( + 'projectValue', + 'locationValue', + 'networkPolicyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.networkPolicyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNetworkPolicyName', () => { + const result = client.matchProjectFromNetworkPolicyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.networkPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNetworkPolicyName', () => { + const result = client.matchLocationFromNetworkPolicyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.networkPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNetworkPolicyFromNetworkPolicyName', () => { + const result = client.matchNetworkPolicyFromNetworkPolicyName(fakePath); + assert.strictEqual(result, 'networkPolicyValue'); + assert( + (client.pathTemplates.networkPolicyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('nodeType', () => { + const fakePath = '/rendered/path/nodeType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + node_type: 'nodeTypeValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.nodeTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.nodeTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('nodeTypePath', () => { + const result = client.nodeTypePath( + 'projectValue', + 'locationValue', + 'nodeTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.nodeTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNodeTypeName', () => { + const result = client.matchProjectFromNodeTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.nodeTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNodeTypeName', () => { + const result = client.matchLocationFromNodeTypeName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.nodeTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNodeTypeFromNodeTypeName', () => { + const result = client.matchNodeTypeFromNodeTypeName(fakePath); + assert.strictEqual(result, 'nodeTypeValue'); + assert( + (client.pathTemplates.nodeTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('privateCloud', () => { + const fakePath = '/rendered/path/privateCloud'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_cloud: 'privateCloudValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.privateCloudPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.privateCloudPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('privateCloudPath', () => { + const result = client.privateCloudPath( + 'projectValue', + 'locationValue', + 'privateCloudValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.privateCloudPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromPrivateCloudName', () => { + const result = client.matchProjectFromPrivateCloudName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.privateCloudPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromPrivateCloudName', () => { + const result = client.matchLocationFromPrivateCloudName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.privateCloudPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateCloudFromPrivateCloudName', () => { + const result = client.matchPrivateCloudFromPrivateCloudName(fakePath); + assert.strictEqual(result, 'privateCloudValue'); + assert( + (client.pathTemplates.privateCloudPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + 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('subnet', () => { + const fakePath = '/rendered/path/subnet'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + private_cloud: 'privateCloudValue', + subnet: 'subnetValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.subnetPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.subnetPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('subnetPath', () => { + const result = client.subnetPath( + 'projectValue', + 'locationValue', + 'privateCloudValue', + 'subnetValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.subnetPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSubnetName', () => { + const result = client.matchProjectFromSubnetName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.subnetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSubnetName', () => { + const result = client.matchLocationFromSubnetName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.subnetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchPrivateCloudFromSubnetName', () => { + const result = client.matchPrivateCloudFromSubnetName(fakePath); + assert.strictEqual(result, 'privateCloudValue'); + assert( + (client.pathTemplates.subnetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSubnetFromSubnetName', () => { + const result = client.matchSubnetFromSubnetName(fakePath); + assert.strictEqual(result, 'subnetValue'); + assert( + (client.pathTemplates.subnetPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('vmwareEngineNetwork', () => { + const fakePath = '/rendered/path/vmwareEngineNetwork'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + vmware_engine_network: 'vmwareEngineNetworkValue', + }; + const client = new vmwareengineModule.v1.VmwareEngineClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.vmwareEngineNetworkPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.vmwareEngineNetworkPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('vmwareEngineNetworkPath', () => { + const result = client.vmwareEngineNetworkPath( + 'projectValue', + 'locationValue', + 'vmwareEngineNetworkValue' + ); + assert.strictEqual(result, fakePath); + assert( + ( + client.pathTemplates.vmwareEngineNetworkPathTemplate + .render as SinonStub + ) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromVmwareEngineNetworkName', () => { + const result = client.matchProjectFromVmwareEngineNetworkName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + ( + client.pathTemplates.vmwareEngineNetworkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromVmwareEngineNetworkName', () => { + const result = + client.matchLocationFromVmwareEngineNetworkName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + ( + client.pathTemplates.vmwareEngineNetworkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchVmwareEngineNetworkFromVmwareEngineNetworkName', () => { + const result = + client.matchVmwareEngineNetworkFromVmwareEngineNetworkName(fakePath); + assert.strictEqual(result, 'vmwareEngineNetworkValue'); + assert( + ( + client.pathTemplates.vmwareEngineNetworkPathTemplate + .match as SinonStub + ) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-vmwareengine/tsconfig.json b/packages/google-cloud-vmwareengine/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-vmwareengine/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-vmwareengine/webpack.config.js b/packages/google-cloud-vmwareengine/webpack.config.js new file mode 100644 index 00000000000..943c4da15f9 --- /dev/null +++ b/packages/google-cloud-vmwareengine/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: 'VmwareEngine', + filename: './vmware-engine.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader', + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader', + }, + ], + }, + mode: 'production', +}; diff --git a/release-please-config.json b/release-please-config.json index e5f2d67a8d1..ddfdd72f67a 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -121,7 +121,8 @@ "packages/google-monitoring-dashboard": {}, "packages/google-storagetransfer": {}, "packages/grafeas": {}, - "packages/typeless-sample-bot": {} + "packages/typeless-sample-bot": {}, + "packages/google-cloud-vmwareengine": {} }, "plugins": [ {