From ebd0bf23b4b17793aae5b161653eed84338fdcf7 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Sat, 2 Oct 2021 01:11:27 +0000 Subject: [PATCH 01/47] feat: initial stub of library --- .../CODE_OF_CONDUCT.md | 94 ++++++++ .../google-cloud-datafusion/CONTRIBUTING.md | 76 +++++++ packages/google-cloud-datafusion/LICENSE | 202 ++++++++++++++++++ packages/google-cloud-datafusion/README.md | 125 +++++++++++ 4 files changed, 497 insertions(+) create mode 100644 packages/google-cloud-datafusion/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-datafusion/CONTRIBUTING.md create mode 100644 packages/google-cloud-datafusion/LICENSE create mode 100644 packages/google-cloud-datafusion/README.md diff --git a/packages/google-cloud-datafusion/CODE_OF_CONDUCT.md b/packages/google-cloud-datafusion/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-datafusion/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-datafusion/CONTRIBUTING.md b/packages/google-cloud-datafusion/CONTRIBUTING.md new file mode 100644 index 00000000000..40afdc1416c --- /dev/null +++ b/packages/google-cloud-datafusion/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# How to become a contributor and submit your own code + +**Table of contents** + +* [Contributor License Agreements](#contributor-license-agreements) +* [Contributing a patch](#contributing-a-patch) +* [Running the tests](#running-the-tests) +* [Releasing the library](#releasing-the-library) + +## Contributor License Agreements + +We'd love to accept your sample apps and patches! Before we can take them, we +have to jump a couple of legal hurdles. + +Please fill out either the individual or corporate Contributor License Agreement +(CLA). + + * If you are an individual writing original source code and you're sure you + own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). + * If you work for a company that wants to allow you to contribute your work, + then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). + +Follow either of the two links above to access the appropriate CLA and +instructions for how to sign and return it. Once we receive it, we'll be able to +accept your pull requests. + +## Contributing A Patch + +1. Submit an issue describing your proposed change to the repo in question. +1. The repo owner will respond to your issue promptly. +1. If your proposed change is accepted, and you haven't already done so, sign a + Contributor License Agreement (see details above). +1. Fork the desired repo, develop and test your code changes. +1. Ensure that your code adheres to the existing style in the code to which + you are contributing. +1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. +1. Submit a pull request. + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Data Fusion 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=datafusion.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-datafusion/LICENSE b/packages/google-cloud-datafusion/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-datafusion/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-datafusion/README.md b/packages/google-cloud-datafusion/README.md new file mode 100644 index 00000000000..eb9335cf4ad --- /dev/null +++ b/packages/google-cloud-datafusion/README.md @@ -0,0 +1,125 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Data Fusion: Node.js Client](https://github.com/googleapis/nodejs-data-fusion) + +[![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/data-fusion.svg)](https://www.npmjs.org/package/@google-cloud/data-fusion) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-fusion/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-fusion) + + + + +datafusion client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-data-fusion/blob/master/CHANGELOG.md). + +* [Cloud Data Fusion Node.js Client API Reference][client-docs] +* [Cloud Data Fusion Documentation][product-docs] +* [github.com/googleapis/nodejs-data-fusion](https://github.com/googleapis/nodejs-data-fusion) + +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) + + +* [Versioning](#versioning) +* [Contributing](#contributing) +* [License](#license) + +## Quickstart + +### Before you begin + +1. [Select or create a Cloud Platform project][projects]. +1. [Enable billing for your project][billing]. +1. [Enable the Cloud Data Fusion 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/data-fusion +``` + + + + + +The [Cloud Data Fusion 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. + +Client libraries targeting some end-of-life versions of Node.js are available, and +can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). +The dist-tags follow the naming convention `legacy-(version)`. + +_Legacy Node.js versions are supported as a best effort:_ + +* Legacy versions will not be tested in continuous integration. +* Some security patches may not be able to be backported. +* Dependencies will not be kept up-to-date, and features will not be backported. + +#### Legacy tags available + +* `legacy-8`: install client libraries from this dist-tag 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/nodejs-data-fusion/blob/master/CONTRIBUTING.md). + +Please note that this `README.md`, the `samples/README.md`, +and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) +are generated from a central template. To edit one of these files, make an edit +to its templates in +[directory](https://github.com/googleapis/synthtool). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-data-fusion/blob/master/LICENSE) + +[client-docs]: https://cloud.google.com/data-fusion +[product-docs]: https://cloud.google.com/data-fusion/ +[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=datafusion.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started From e55a6662c0f6adc7903993c1dba33b9e08657160 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Mon, 4 Oct 2021 20:08:53 +0000 Subject: [PATCH 02/47] feat: add templated files from docker image --- .../google-cloud-datafusion/.eslintignore | 6 + .../google-cloud-datafusion/.eslintrc.json | 3 + .../google-cloud-datafusion/.gitattributes | 4 + .../.github/.OwlBot.yaml | 22 + packages/google-cloud-datafusion/.gitignore | 14 + packages/google-cloud-datafusion/.jsdoc.js | 55 + packages/google-cloud-datafusion/.mocharc.js | 29 + packages/google-cloud-datafusion/.nycrc | 24 + .../google-cloud-datafusion/.prettierignore | 6 + .../google-cloud-datafusion/.prettierrc.js | 17 + .../.repo-metadata.json | 15 + .../linkinator.config.json | 1 + packages/google-cloud-datafusion/package.json | 1 + .../cloud/datafusion/v1/datafusion.proto | 519 + .../cloud/datafusion/v1beta1/v1beta1.proto | 712 + .../protos/protos.d.ts | 11074 ++++++ .../google-cloud-datafusion/protos/protos.js | 27686 ++++++++++++++++ .../protos/protos.json | 3037 ++ .../v1/data_fusion.create_instance.js | 62 + .../v1/data_fusion.delete_instance.js | 54 + .../generated/v1/data_fusion.get_instance.js | 53 + .../v1/data_fusion.list_available_versions.js | 71 + .../v1/data_fusion.list_instances.js | 74 + .../v1/data_fusion.restart_instance.js | 54 + .../v1/data_fusion.update_instance.js | 64 + .../v1beta1/data_fusion.add_dns_peering.js | 56 + .../v1beta1/data_fusion.create_instance.js | 62 + .../v1beta1/data_fusion.delete_instance.js | 54 + .../v1beta1/data_fusion.get_instance.js | 53 + .../data_fusion.list_available_versions.js | 71 + .../v1beta1/data_fusion.list_dns_peerings.js | 64 + .../v1beta1/data_fusion.list_instances.js | 74 + .../v1beta1/data_fusion.list_namespaces.js | 71 + .../v1beta1/data_fusion.remove_dns_peering.js | 57 + .../v1beta1/data_fusion.remove_iam_policy.js | 52 + .../v1beta1/data_fusion.restart_instance.js | 54 + .../v1beta1/data_fusion.update_instance.js | 64 + .../v1beta1/data_fusion.upgrade_instance.js | 56 + .../samples/package.json | 23 + .../samples/quickstart.js | 50 + .../samples/test/quickstart.js | 53 + packages/google-cloud-datafusion/src/index.ts | 28 + .../src/v1/data_fusion_client.ts | 1286 + .../src/v1/data_fusion_client_config.json | 61 + .../src/v1/data_fusion_proto_list.json | 3 + .../src/v1/gapic_metadata.json | 101 + .../google-cloud-datafusion/src/v1/index.ts | 19 + .../src/v1beta1/data_fusion_client.ts | 2054 ++ .../v1beta1/data_fusion_client_config.json | 91 + .../src/v1beta1/data_fusion_proto_list.json | 3 + .../src/v1beta1/gapic_metadata.json | 169 + .../src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../system-test/install.ts | 49 + .../test/gapic_data_fusion_v1.ts | 1342 + .../test/gapic_data_fusion_v1beta1.ts | 2238 ++ .../google-cloud-datafusion/tsconfig.json | 19 + .../google-cloud-datafusion/v1/.eslintignore | 7 + .../google-cloud-datafusion/v1/.eslintrc.json | 3 + .../google-cloud-datafusion/v1/.gitignore | 14 + packages/google-cloud-datafusion/v1/.jsdoc.js | 55 + .../google-cloud-datafusion/v1/.mocharc.js | 33 + .../google-cloud-datafusion/v1/.prettierrc.js | 22 + packages/google-cloud-datafusion/v1/README.md | 1 + .../v1/linkinator.config.json | 10 + .../google-cloud-datafusion/v1/package.json | 64 + .../cloud/datafusion/v1/datafusion.proto | 519 + .../v1/data_fusion.create_instance.js | 62 + .../v1/data_fusion.delete_instance.js | 54 + .../generated/v1/data_fusion.get_instance.js | 53 + .../v1/data_fusion.list_available_versions.js | 71 + .../v1/data_fusion.list_instances.js | 74 + .../v1/data_fusion.restart_instance.js | 54 + .../v1/data_fusion.update_instance.js | 64 + .../google-cloud-datafusion/v1/src/index.ts | 25 + .../v1/src/v1/data_fusion_client.ts | 1286 + .../v1/src/v1/data_fusion_client_config.json | 61 + .../v1/src/v1/data_fusion_proto_list.json | 3 + .../v1/src/v1/gapic_metadata.json | 101 + .../v1/src/v1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1/system-test/install.ts | 49 + .../v1/test/gapic_data_fusion_v1.ts | 1342 + .../google-cloud-datafusion/v1/tsconfig.json | 19 + .../v1/webpack.config.js | 64 + .../v1beta1/.eslintignore | 7 + .../v1beta1/.eslintrc.json | 3 + .../v1beta1/.gitignore | 14 + .../google-cloud-datafusion/v1beta1/.jsdoc.js | 55 + .../v1beta1/.mocharc.js | 33 + .../v1beta1/.prettierrc.js | 22 + .../google-cloud-datafusion/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 10 + .../v1beta1/package.json | 64 + .../cloud/datafusion/v1beta1/v1beta1.proto | 712 + .../v1beta1/data_fusion.add_dns_peering.js | 56 + .../v1beta1/data_fusion.create_instance.js | 62 + .../v1beta1/data_fusion.delete_instance.js | 54 + .../v1beta1/data_fusion.get_instance.js | 53 + .../data_fusion.list_available_versions.js | 71 + .../v1beta1/data_fusion.list_dns_peerings.js | 64 + .../v1beta1/data_fusion.list_instances.js | 74 + .../v1beta1/data_fusion.list_namespaces.js | 71 + .../v1beta1/data_fusion.remove_dns_peering.js | 57 + .../v1beta1/data_fusion.remove_iam_policy.js | 52 + .../v1beta1/data_fusion.restart_instance.js | 54 + .../v1beta1/data_fusion.update_instance.js | 64 + .../v1beta1/data_fusion.upgrade_instance.js | 56 + .../v1beta1/src/index.ts | 25 + .../v1beta1/src/v1beta1/data_fusion_client.ts | 2054 ++ .../v1beta1/data_fusion_client_config.json | 91 + .../src/v1beta1/data_fusion_proto_list.json | 3 + .../v1beta1/src/v1beta1/gapic_metadata.json | 169 + .../v1beta1/src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 32 + .../v1beta1/system-test/install.ts | 49 + .../v1beta1/test/gapic_data_fusion_v1beta1.ts | 2238 ++ .../v1beta1/tsconfig.json | 19 + .../v1beta1/webpack.config.js | 64 + .../google-cloud-datafusion/webpack.config.js | 64 + 123 files changed, 62863 insertions(+) create mode 100644 packages/google-cloud-datafusion/.eslintignore create mode 100644 packages/google-cloud-datafusion/.eslintrc.json create mode 100644 packages/google-cloud-datafusion/.gitattributes create mode 100644 packages/google-cloud-datafusion/.github/.OwlBot.yaml create mode 100644 packages/google-cloud-datafusion/.gitignore create mode 100644 packages/google-cloud-datafusion/.jsdoc.js create mode 100644 packages/google-cloud-datafusion/.mocharc.js create mode 100644 packages/google-cloud-datafusion/.nycrc create mode 100644 packages/google-cloud-datafusion/.prettierignore create mode 100644 packages/google-cloud-datafusion/.prettierrc.js create mode 100644 packages/google-cloud-datafusion/.repo-metadata.json create mode 100644 packages/google-cloud-datafusion/linkinator.config.json create mode 100644 packages/google-cloud-datafusion/package.json create mode 100644 packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto create mode 100644 packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto create mode 100644 packages/google-cloud-datafusion/protos/protos.d.ts create mode 100644 packages/google-cloud-datafusion/protos/protos.js create mode 100644 packages/google-cloud-datafusion/protos/protos.json create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js create mode 100644 packages/google-cloud-datafusion/samples/package.json create mode 100644 packages/google-cloud-datafusion/samples/quickstart.js create mode 100644 packages/google-cloud-datafusion/samples/test/quickstart.js create mode 100644 packages/google-cloud-datafusion/src/index.ts create mode 100644 packages/google-cloud-datafusion/src/v1/data_fusion_client.ts create mode 100644 packages/google-cloud-datafusion/src/v1/data_fusion_client_config.json create mode 100644 packages/google-cloud-datafusion/src/v1/data_fusion_proto_list.json create mode 100644 packages/google-cloud-datafusion/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-datafusion/src/v1/index.ts create mode 100644 packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts create mode 100644 packages/google-cloud-datafusion/src/v1beta1/data_fusion_client_config.json create mode 100644 packages/google-cloud-datafusion/src/v1beta1/data_fusion_proto_list.json create mode 100644 packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-datafusion/src/v1beta1/index.ts create mode 100644 packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-datafusion/system-test/install.ts create mode 100644 packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts create mode 100644 packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts create mode 100644 packages/google-cloud-datafusion/tsconfig.json create mode 100644 packages/google-cloud-datafusion/v1/.eslintignore create mode 100644 packages/google-cloud-datafusion/v1/.eslintrc.json create mode 100644 packages/google-cloud-datafusion/v1/.gitignore create mode 100644 packages/google-cloud-datafusion/v1/.jsdoc.js create mode 100644 packages/google-cloud-datafusion/v1/.mocharc.js create mode 100644 packages/google-cloud-datafusion/v1/.prettierrc.js create mode 100644 packages/google-cloud-datafusion/v1/README.md create mode 100644 packages/google-cloud-datafusion/v1/linkinator.config.json create mode 100644 packages/google-cloud-datafusion/v1/package.json create mode 100644 packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js create mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js create mode 100644 packages/google-cloud-datafusion/v1/src/index.ts create mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts create mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json create mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json create mode 100644 packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-datafusion/v1/src/v1/index.ts create mode 100644 packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-datafusion/v1/system-test/install.ts create mode 100644 packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts create mode 100644 packages/google-cloud-datafusion/v1/tsconfig.json create mode 100644 packages/google-cloud-datafusion/v1/webpack.config.js create mode 100644 packages/google-cloud-datafusion/v1beta1/.eslintignore create mode 100644 packages/google-cloud-datafusion/v1beta1/.eslintrc.json create mode 100644 packages/google-cloud-datafusion/v1beta1/.gitignore create mode 100644 packages/google-cloud-datafusion/v1beta1/.jsdoc.js create mode 100644 packages/google-cloud-datafusion/v1beta1/.mocharc.js create mode 100644 packages/google-cloud-datafusion/v1beta1/.prettierrc.js create mode 100644 packages/google-cloud-datafusion/v1beta1/README.md create mode 100644 packages/google-cloud-datafusion/v1beta1/linkinator.config.json create mode 100644 packages/google-cloud-datafusion/v1beta1/package.json create mode 100644 packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js create mode 100644 packages/google-cloud-datafusion/v1beta1/src/index.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json create mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json create mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/install.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts create mode 100644 packages/google-cloud-datafusion/v1beta1/tsconfig.json create mode 100644 packages/google-cloud-datafusion/v1beta1/webpack.config.js create mode 100644 packages/google-cloud-datafusion/webpack.config.js diff --git a/packages/google-cloud-datafusion/.eslintignore b/packages/google-cloud-datafusion/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-datafusion/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-datafusion/.eslintrc.json b/packages/google-cloud-datafusion/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-datafusion/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-datafusion/.gitattributes b/packages/google-cloud-datafusion/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-datafusion/.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-datafusion/.github/.OwlBot.yaml b/packages/google-cloud-datafusion/.github/.OwlBot.yaml new file mode 100644 index 00000000000..0b54cd56bbf --- /dev/null +++ b/packages/google-cloud-datafusion/.github/.OwlBot.yaml @@ -0,0 +1,22 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +docker: + image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + +deep-remove-regex: + - /owl-bot-staging + +deep-copy-regex: + - source: /google/cloud/datafusion/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-cloud-datafusion/.gitignore b/packages/google-cloud-datafusion/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-datafusion/.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-datafusion/.jsdoc.js b/packages/google-cloud-datafusion/.jsdoc.js new file mode 100644 index 00000000000..37689bedd59 --- /dev/null +++ b/packages/google-cloud-datafusion/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/datafusion', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-datafusion/.mocharc.js b/packages/google-cloud-datafusion/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-datafusion/.mocharc.js @@ -0,0 +1,29 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000, + "recursive": true +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/packages/google-cloud-datafusion/.nycrc b/packages/google-cloud-datafusion/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-datafusion/.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-datafusion/.prettierignore b/packages/google-cloud-datafusion/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-datafusion/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-datafusion/.prettierrc.js b/packages/google-cloud-datafusion/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-datafusion/.prettierrc.js @@ -0,0 +1,17 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-datafusion/.repo-metadata.json b/packages/google-cloud-datafusion/.repo-metadata.json new file mode 100644 index 00000000000..926b45c6b13 --- /dev/null +++ b/packages/google-cloud-datafusion/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "name": "datafusion", + "name_pretty": "Cloud Data Fusion", + "product_documentation": "https://cloud.google.com/data-fusion/", + "client_documentation": "https://cloud.google.com/data-fusion", + "issue_tracker": "https://issuetracker.google.com/savedsearches/5552618", + "release_level": "beta", + "language": "nodejs", + "repo": "googleapis/nodejs-data-fusion", + "distribution_name": "@google-cloud/data-fusion", + "api_id": "datafusion.googleapis.com", + "default_version": "v1", + "requires_billing": true +} + diff --git a/packages/google-cloud-datafusion/linkinator.config.json b/packages/google-cloud-datafusion/linkinator.config.json new file mode 100644 index 00000000000..0947c2e0e5b --- /dev/null +++ b/packages/google-cloud-datafusion/linkinator.config.json @@ -0,0 +1 @@ +{"recurse":true,"skip":["https://codecov.io/gh/googleapis/","www.googleapis.com","img.shields.io"],"silent":true,"concurrency":10} \ No newline at end of file diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json new file mode 100644 index 00000000000..433ba6956be --- /dev/null +++ b/packages/google-cloud-datafusion/package.json @@ -0,0 +1 @@ +{"name":"@google-cloud/data-fusion","version":"0.1.0","description":"datafusion client for Node.js","repository":"googleapis/googleapis/nodejs-data-fusion","license":"Apache-2.0","author":"Google LLC","main":"build/src/index.js","files":["build/src","build/protos"],"keywords":["google apis client","google api client","google apis","google api","google","google cloud platform","google cloud","cloud","google datafusion","datafusion","datafusion service"],"scripts":{"clean":"gts clean","compile":"tsc -p . && cp -r protos build/","compile-protos":"compileProtos src","docs":"jsdoc -c .jsdoc.js","predocs-test":"npm run docs","docs-test":"linkinator docs","fix":"gts fix","lint":"gts check","prepare":"npm run compile-protos && npm run compile","system-test":"c8 mocha build/system-test","test":"c8 mocha build/test","samples-test":"cd samples/ && npm link ../ && npm test","prelint":"cd samples; npm link ../; npm i"},"dependencies":{"google-gax":"^2.12.0"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.44","@types/sinon":"^10.0.0","c8":"^7.7.2","gts":"^3.1.0","jsdoc":"^3.6.6","jsdoc-fresh":"^1.0.2","jsdoc-region-tag":"^1.0.6","linkinator":"^2.13.6","mocha":"^8.4.0","null-loader":"^4.0.1","pack-n-play":"^1.0.0-2","sinon":"^10.0.0","ts-loader":"^9.1.2","typescript":"^4.2.4","webpack":"^5.36.2","webpack-cli":"^4.7.0"},"engines":{"node":">=v10.0.0"}} \ No newline at end of file diff --git a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto new file mode 100644 index 00000000000..aae228337b8 --- /dev/null +++ b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto @@ -0,0 +1,519 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datafusion.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.DataFusion.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1;datafusion"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datafusion.v1"; +option php_namespace = "Google\\Cloud\\DataFusion\\V1"; +option ruby_package = "Google::Cloud::DataFusion::V1"; + +// Service for creating and managing Data Fusion instances. +// Data Fusion enables ETL developers to build code-free, data integration +// pipelines via a point-and-click UI. +service DataFusion { + option (google.api.default_host) = "datafusion.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists possible versions for Data Fusion instances in the specified project + // and location. + rpc ListAvailableVersions(ListAvailableVersionsRequest) + returns (ListAvailableVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Data Fusion instances in the specified project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + } + + // Gets details of a single Data Fusion instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + } + + // Creates a new Data Fusion instance in the specified project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Date Fusion instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a single Data Fusion instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart a single Data Fusion instance. + // At the end of an operation instance is fully restarted. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } +} + +// Network configuration for a Data Fusion instance. These configurations +// are used for peering with the customer network. Configurations are optional +// when a public Data Fusion instance is to be created. However, providing +// these configurations allows several benefits, such as reduced network latency +// while accessing the customer resources from managed Data Fusion instance +// nodes, as well as access to the customer on-prem resources. +message NetworkConfig { + // Name of the network in the customer project with which the Tenant Project + // will be peered for executing pipelines. In case of shared VPC where the + // network resides in another host project the network should specified in + // the form of projects/{host-project-id}/global/networks/{network} + string network = 1; + + // The IP range in CIDR notation to use for the managed Data Fusion instance + // nodes. This range must not overlap with any other ranges used in the + // customer network. + string ip_allocation = 2; +} + +// The Data Fusion version. This proto message stores information about certain +// Data Fusion version, which is used for Data Fusion version upgrade. +message Version { + // The version number of the Data Fusion instance, such as '6.0.1.0'. + string version_number = 1; + + // Whether this is currently the default version for Cloud Data Fusion + bool default_version = 2; + + // Represents a list of available feature names for a given version. + repeated string available_features = 3; +} + +// Identifies Data Fusion accelerators for an instance. +message Accelerator { + // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion + // service. + enum AcceleratorType { + // Default value, if unspecified. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Change Data Capture accelerator for CDF. + CDC = 1; + + // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud + // Healthcare specific CDF plugins developed by Healthcare team. + HEALTHCARE = 2; + + // Contact Center AI Insights + // This accelerator is used to enable import and export pipelines + // custom built to streamline CCAI Insights processing. + CCAI_INSIGHTS = 3; + } + + // Different values possible for the state of an accelerator + enum State { + // Default value, do not use + STATE_UNSPECIFIED = 0; + + // Indicates that the accelerator is enabled and available to use + ENABLED = 1; + + // Indicates that the accelerator is disabled and not available to use + DISABLED = 2; + + // Indicates that accelerator state is currently unknown. + // Requests for enable, disable could be retried while in this state + UNKNOWN = 3; + } + + // The type of an accelator for a CDF instance. + AcceleratorType accelerator_type = 1; + + // The state of the accelerator + State state = 2; +} + +// The crypto key configuration. This field is used by the Customer-managed +// encryption keys (CMEK) feature. +message CryptoKeyConfig { + // The name of the key which is used to encrypt/decrypt customer data. For key + // in Cloud KMS, the key should be in the format of + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string key_reference = 1; +} + +// Represents a Data Fusion instance. +message Instance { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Represents the type of Data Fusion instance. Each type is configured with + // the default settings for processing and memory. + enum Type { + // No type specified. The instance creation will fail. + TYPE_UNSPECIFIED = 0; + + // Basic Data Fusion instance. In Basic type, the user will be able to + // create data pipelines using point and click UI. However, there are + // certain limitations, such as fewer number of concurrent pipelines, no + // support for streaming pipelines, etc. + BASIC = 1; + + // Enterprise Data Fusion instance. In Enterprise type, the user will have + // all features available, such as support for streaming pipelines, higher + // number of concurrent pipelines, etc. + ENTERPRISE = 2; + + // Developer Data Fusion instance. In Developer type, the user will have all + // features available but with restrictive capabilities. This is to help + // enterprises design and develop their data ingestion and integration + // pipelines at low cost. + DEVELOPER = 3; + } + + // Represents the state of a Data Fusion instance + enum State { + // Instance does not have a state yet + STATE_UNSPECIFIED = 0; + + // Instance is being created + CREATING = 1; + + // Instance is active and ready for requests. This corresponds to 'RUNNING' + // in datafusion.v1beta1. + ACTIVE = 2; + + // Instance creation failed + FAILED = 3; + + // Instance is being deleted + DELETING = 4; + + // Instance is being upgraded + UPGRADING = 5; + + // Instance is being restarted + RESTARTING = 6; + + // Instance is being updated on customer request + UPDATING = 7; + + // Instance is being auto-updated + AUTO_UPDATING = 8; + + // Instance is being auto-upgraded + AUTO_UPGRADING = 9; + } + + // Output only. The name of this instance is in the form of + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of this instance. + string description = 2; + + // Required. Instance type. + Type type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Option to enable Stackdriver Logging. + bool enable_stackdriver_logging = 4; + + // Option to enable Stackdriver Monitoring. + bool enable_stackdriver_monitoring = 5; + + // Specifies whether the Data Fusion instance should be private. If set to + // true, all Data Fusion nodes will have private IP addresses and will not be + // able to access the public internet. + bool private_instance = 6; + + // Network configuration options. These are required when a private Data + // Fusion instance is to be created. + NetworkConfig network_config = 7; + + // The resource labels for instance to use to annotate any related underlying + // resources such as Compute Engine VMs. The character '=' is not allowed to + // be used within the labels. + map labels = 8; + + // Map of additional options used to configure the behavior of + // Data Fusion instance. + map options = 9; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this Data Fusion instance. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of this Data + // Fusion instance if available. + string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Endpoint on which the Data Fusion UI is accessible. + string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the zone in which the Data Fusion instance will be created. Only + // DEVELOPER instances use this field. + string zone = 15; + + // Current version of the Data Fusion. Only specifiable in Update. + string version = 16; + + // Output only. Deprecated. Use tenant_project_id instead to extract the + // tenant project ID. + string service_account = 17 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name for an instance. + string display_name = 18; + + // Available versions that the instance can be upgraded to using + // UpdateInstanceRequest. + repeated Version available_version = 19; + + // Output only. Endpoint on which the REST APIs is accessible. + string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Storage bucket generated by Data Fusion in the customer + // project. + string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of accelerators enabled for this CDF instance. + repeated Accelerator accelerators = 22; + + // Output only. P4 service account for the customer project. + string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the tenant project. + string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-managed service account to set on Dataproc when Cloud Data Fusion + // creates Dataproc to run data processing pipelines. + // + // This allows users to have fine-grained access control on Dataproc's + // accesses to cloud resources. + string dataproc_service_account = 25; + + // Option to enable granular role-based access control. + bool enable_rbac = 27; + + // The crypto key configuration. This field is used by the Customer-Managed + // Encryption Keys (CMEK) feature. + CryptoKeyConfig crypto_key_config = 28; +} + +// Request message for listing Data Fusion instances. +message ListInstancesRequest { + // The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. If the location is + // specified as '-' (wildcard), then all regions available to the project + // are queried, and the results are aggregated. + string parent = 1; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // List filter. + string filter = 4; + + // Sort results. Supported values are "name", "name desc", or "" (unsorted). + string order_by = 5; +} + +// Response message for the list instance request. +message ListInstancesResponse { + // Represents a list of Data Fusion instances. + repeated Instance instances = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for the list available versions request. +message ListAvailableVersionsRequest { + // Required. The project and location for which to retrieve instance + // information in the format projects/{project}/locations/{location}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Whether or not to return the latest patch of every available minor version. + // If true, only the latest patch will be returned. Ex. if allowed versions is + // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + bool latest_patch_only = 4; +} + +// Response message for the list available versions request. +message ListAvailableVersionsResponse { + // Represents a list of versions that are supported. + repeated Version available_versions = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for getting details about a Data Fusion instance. +message GetInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; +} + +// Request message for creating a Data Fusion instance. +message CreateInstanceRequest { + // The instance's project and location in the format + // projects/{project}/locations/{location}. + string parent = 1; + + // The name of the instance to create. + string instance_id = 2; + + // An instance resource. + Instance instance = 3; +} + +// Request message for deleting a Data Fusion instance. +message DeleteInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +message UpdateInstanceRequest { + // The instance resource that replaces the resource on the server. Currently, + // Data Fusion only allows replacing labels, options, and stack driver + // settings. All other fields will be ignored. + Instance instance = 1; + + // Field mask is used to specify the fields that the update will overwrite + // in an instance resource. 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, all the supported fields (labels, + // options, and version currently) will be overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for restarting a Data Fusion instance. +message RestartInstanceRequest { + // Name of the Data Fusion instance which need to be restarted in the form of + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; + + // Map to hold any additional status info for the operation + // If there is an accelerator being enabled/disabled/deleted, this will be + // populated with accelerator name as key and status as + // ENABLING, DISABLING or DELETING + map additional_status = 8; +} diff --git a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto new file mode 100644 index 00000000000..d3f9565f92d --- /dev/null +++ b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto @@ -0,0 +1,712 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datafusion.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DataFusion.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1beta1;datafusion"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datafusion.v1beta1"; +option php_namespace = "Google\\Cloud\\DataFusion\\V1beta1"; +option ruby_package = "Google::Cloud::DataFusion::V1beta1"; + +// Service for creating and managing Data Fusion instances. +// Data Fusion enables ETL developers to build code-free, data integration +// pipelines via a point-and-click UI. +service DataFusion { + option (google.api.default_host) = "datafusion.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists possible versions for Data Fusion instances in the specified project + // and location. + rpc ListAvailableVersions(ListAvailableVersionsRequest) + returns (ListAvailableVersionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Data Fusion instances in the specified project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/instances" + }; + } + + // Gets details of a single Data Fusion instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + } + + // Creates a new Data Fusion instance in the specified project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Data Fusion instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a single Data Fusion instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart a single Data Fusion instance. + // At the end of an operation instance is fully restarted. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Upgrade a single Data Fusion instance. + // At the end of an operation instance is fully upgraded. + rpc UpgradeInstance(UpgradeInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Remove IAM policy that is currently set on the given resource. + rpc RemoveIamPolicy(RemoveIamPolicyRequest) + returns (RemoveIamPolicyResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy" + body: "*" + }; + } + + // List namespaces in a given instance + rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/namespaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Add DNS peering on the given resource. + rpc AddDnsPeering(AddDnsPeeringRequest) returns (AddDnsPeeringResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:add" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Remove DNS peering on the given resource. + rpc RemoveDnsPeering(RemoveDnsPeeringRequest) + returns (RemoveDnsPeeringResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // List DNS peering for a given resource. + rpc ListDnsPeerings(ListDnsPeeringsRequest) + returns (ListDnsPeeringsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Network configuration for a Data Fusion instance. These configurations +// are used for peering with the customer network. Configurations are optional +// when a public Data Fusion instance is to be created. However, providing +// these configurations allows several benefits, such as reduced network latency +// while accessing the customer resources from managed Data Fusion instance +// nodes, as well as access to the customer on-prem resources. +message NetworkConfig { + // Name of the network in the customer project with which the Tenant Project + // will be peered for executing pipelines. In case of shared VPC where the + // network resides in another host project the network should specified in + // the form of projects/{host-project-id}/global/networks/{network} + string network = 1; + + // The IP range in CIDR notation to use for the managed Data Fusion instance + // nodes. This range must not overlap with any other ranges used in the Data + // Fusion instance network. + string ip_allocation = 2; +} + +// The Data Fusion version. +message Version { + // The version number of the Data Fusion instance, such as '6.0.1.0'. + string version_number = 1; + + // Whether this is currently the default version for Cloud Data Fusion + bool default_version = 2; + + // Represents a list of available feature names for a given version. + repeated string available_features = 3; +} + +// Identifies Data Fusion accelerators for an instance. +message Accelerator { + // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion + // service. + enum AcceleratorType { + // Default value, if unspecified. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Change Data Capture accelerator for CDF. + CDC = 1; + + // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud + // Healthcare specific CDF plugins developed by Healthcare team. + HEALTHCARE = 2; + } + + // The type of an accelator for a CDF instance. + AcceleratorType accelerator_type = 1; +} + +// The crypto key configuration. This field is used by the Customer-managed +// encryption keys (CMEK) feature. +message CryptoKeyConfig { + // The name of the key which is used to encrypt/decrypt customer data. For key + // in Cloud KMS, the key should be in the format of + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string key_reference = 1; +} + +// Represents a Data Fusion instance. +message Instance { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Represents the type of Data Fusion instance. Each type is configured with + // the default settings for processing and memory. + enum Type { + // No type specified. The instance creation will fail. + TYPE_UNSPECIFIED = 0; + + // Basic Data Fusion instance. In Basic type, the user will be able to + // create data pipelines using point and click UI. However, there are + // certain limitations, such as fewer number of concurrent pipelines, no + // support for streaming pipelines, etc. + BASIC = 1; + + // Enterprise Data Fusion instance. In Enterprise type, the user will have + // all features available, such as support for streaming pipelines, + // unlimited number of concurrent pipelines, etc. + ENTERPRISE = 2; + + // Developer Data Fusion instance. In Developer type, the user will have all + // features available but with restrictive capabilities. This is to help + // enterprises design and develop their data ingestion and integration + // pipelines at low cost. + DEVELOPER = 3; + } + + // Represents the state of a Data Fusion instance + enum State { + // Instance does not have a state yet + STATE_UNSPECIFIED = 0; + + // Instance is being created + CREATING = 1; + + // Instance is running and ready for requests + RUNNING = 2; + + // Instance creation failed + FAILED = 3; + + // Instance is being deleted + DELETING = 4; + + // Instance is being upgraded + UPGRADING = 5; + + // Instance is being restarted + RESTARTING = 6; + + // Instance is being updated on customer request + UPDATING = 7; + + // Instance is being auto-updated + AUTO_UPDATING = 8; + + // Instance is being auto-upgraded + AUTO_UPGRADING = 9; + } + + // Output only. The name of this instance is in the form of + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of this instance. + string description = 2; + + // Required. Instance type. + Type type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Option to enable Stackdriver Logging. + bool enable_stackdriver_logging = 4; + + // Option to enable Stackdriver Monitoring. + bool enable_stackdriver_monitoring = 5; + + // Specifies whether the Data Fusion instance should be private. If set to + // true, all Data Fusion nodes will have private IP addresses and will not be + // able to access the public internet. + bool private_instance = 6; + + // Network configuration options. These are required when a private Data + // Fusion instance is to be created. + NetworkConfig network_config = 7; + + // The resource labels for instance to use to annotate any related underlying + // resources such as Compute Engine VMs. The character '=' is not allowed to + // be used within the labels. + map labels = 8; + + // Map of additional options used to configure the behavior of + // Data Fusion instance. + map options = 9; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this Data Fusion instance. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of this Data + // Fusion instance if available. + string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Endpoint on which the Data Fusion UI is accessible. + string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the zone in which the Data Fusion instance will be created. Only + // DEVELOPER instances use this field. + string zone = 15; + + // Current version of Data Fusion. + string version = 16; + + // Output only. Deprecated. Use tenant_project_id instead to extract the + // tenant project ID. + string service_account = 17 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name for an instance. + string display_name = 18; + + // Available versions that the instance can be upgraded to using + // UpdateInstanceRequest. + repeated Version available_version = 19; + + // Output only. Endpoint on which the REST APIs is accessible. + string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Storage bucket generated by Data Fusion in the customer + // project. + string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of accelerators enabled for this CDF instance. + repeated Accelerator accelerators = 22; + + // Output only. P4 service account for the customer project. + string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the tenant project. + string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-managed service account to set on Dataproc when Cloud Data Fusion + // creates Dataproc to run data processing pipelines. + // + // This allows users to have fine-grained access control on Dataproc's + // accesses to cloud resources. + string dataproc_service_account = 25; + + // Option to enable granular role-based access control. + bool enable_rbac = 26; + + // The crypto key configuration. This field is used by the Customer-Managed + // Encryption Keys (CMEK) feature. + CryptoKeyConfig crypto_key_config = 27; +} + +// Request message for listing Data Fusion instances. +message ListInstancesRequest { + // The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. If the location is + // specified as '-' (wildcard), then all regions available to the project + // are queried, and the results are aggregated. + string parent = 1; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // List filter. + string filter = 4; + + // Sort results. Supported values are "name", "name desc", or "" (unsorted). + string order_by = 5; +} + +// Response message for the list instance request. +message ListInstancesResponse { + // Represents a list of Data Fusion instances. + repeated Instance instances = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for the list available versions request. +message ListAvailableVersionsRequest { + // Required. The project and location for which to retrieve instance + // information in the format projects/{project}/locations/{location}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Whether or not to return the latest patch of every available minor version. + // If true, only the latest patch will be returned. Ex. if allowed versions is + // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + bool latest_patch_only = 4; +} + +// Response message for the list available versions request. +message ListAvailableVersionsResponse { + // Represents a list of versions that are supported. + repeated Version available_versions = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for getting details about a Data Fusion instance. +message GetInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; +} + +// Request message for creating a Data Fusion instance. +message CreateInstanceRequest { + // The instance's project and location in the format + // projects/{project}/locations/{location}. + string parent = 1; + + // The name of the instance to create. + string instance_id = 2; + + // An instance resource. + Instance instance = 3; +} + +// Request message for deleting a Data Fusion instance. +message DeleteInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Request message for updating a Data Fusion instance. +// Data Fusion only allows updating the labels, options, and stack driver +// settings. +message UpdateInstanceRequest { + // The instance resource that replaces the resource on the server. Currently, + // Data Fusion only allows replacing labels, options, and stack driver + // settings. All other fields will be ignored. + Instance instance = 1; + + // Field mask is used to specify the fields that the update will overwrite + // in an instance resource. 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, all the supported fields (labels and + // options currently) will be overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for restarting a Data Fusion instance. +message RestartInstanceRequest { + // Name of the Data Fusion instance which need to be restarted in the form of + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Request message for upgrading a Data Fusion instance. +// To change the instance properties, instance update should be used. +message UpgradeInstanceRequest { + // Name of the Data Fusion instance which need to be upgraded in the form of + // projects/{project}/locations/{location}/instances/{instance} + // Instance will be upgraded with the latest stable version of the Data + // Fusion. + string name = 1; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// Request message for RemoveIamPolicy method. +message RemoveIamPolicyRequest { + // The resource on which IAM policy to be removed is attached to. + string resource = 1; +} + +// Response message for RemoveIamPolicy method. +message RemoveIamPolicyResponse {} + +// List namespaces request. +message ListNamespacesRequest { + // Required. The instance to list its namespaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // By default, only basic information about a namespace is returned + // (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + // information associated with a namespace gets returned + // (e.g. IAM policy set on the namespace) + NamespaceView view = 4; +} + +// IAMPolicy encapsulates the IAM policy name, definition and status of +// policy fetching. +message IAMPolicy { + // Policy definition if IAM policy fetching is successful, + // otherwise empty. + google.iam.v1.Policy policy = 1; + + // Status of iam policy fetching. + google.rpc.Status status = 2; +} + +// Represents the information of a namespace +message Namespace { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Namespace" + pattern: "projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}" + }; + + // Name of the given namespace. + string name = 1; + + // IAM policy associated with this namespace. + IAMPolicy iam_policy = 2; +} + +// List namespaces response. +message ListNamespacesResponse { + // List of namespaces + repeated Namespace namespaces = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// DNS peering configuration. These configurations are used to create +// DNS peering with the customer Cloud DNS. +message DnsPeering { + // Required. Name of the zone. + string zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the dns. + string domain = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional description of the dns zone. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional target project to which dns peering should happen. + string target_project = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional target network to which dns peering should happen. + string target_network = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to create dns peering. +message AddDnsPeeringRequest { + // The resource on which DNS peering will be created. + string parent = 1; + + // Dns peering config. + DnsPeering dns_peering = 2; +} + +// Response message for set dns peering method. +message AddDnsPeeringResponse {} + +// A view for Namespace +enum NamespaceView { + // Default/unset value, which will use BASIC view. + NAMESPACE_VIEW_UNSPECIFIED = 0; + + // Show the most basic metadata of a namespace + NAMESPACE_VIEW_BASIC = 1; + + // Returns all metadata of a namespace + NAMESPACE_VIEW_FULL = 2; +} + +// Request message to remove dns peering. +message RemoveDnsPeeringRequest { + // The resource on which DNS peering will be removed. + string parent = 1; + + // Required. The zone to be removed. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for set dns peering method. +message RemoveDnsPeeringResponse {} + +// List dns peering request. +message ListDnsPeeringsRequest { + // Required. The resource on which dns peering will be listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; +} + +// List dns peering response. +message ListDnsPeeringsResponse { + // List of dns peering configs. + repeated DnsPeering dns_peerings = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts new file mode 100644 index 00000000000..8b3b679edab --- /dev/null +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -0,0 +1,11074 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import * as Long from "long"; +import {protobuf as $protobuf} from "google-gax"; +/** Namespace google. */ +export namespace google { + + /** Namespace cloud. */ + namespace cloud { + + /** Namespace datafusion. */ + namespace datafusion { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a DataFusion */ + class DataFusion extends $protobuf.rpc.Service { + + /** + * Constructs a new DataFusion 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 DataFusion 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): DataFusion; + + /** + * Calls ListAvailableVersions. + * @param request ListAvailableVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAvailableVersionsResponse + */ + public listAvailableVersions(request: google.cloud.datafusion.v1.IListAvailableVersionsRequest, callback: google.cloud.datafusion.v1.DataFusion.ListAvailableVersionsCallback): void; + + /** + * Calls ListAvailableVersions. + * @param request ListAvailableVersionsRequest message or plain object + * @returns Promise + */ + public listAvailableVersions(request: google.cloud.datafusion.v1.IListAvailableVersionsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.datafusion.v1.IListInstancesRequest, callback: google.cloud.datafusion.v1.DataFusion.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.datafusion.v1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.datafusion.v1.IGetInstanceRequest, callback: google.cloud.datafusion.v1.DataFusion.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.datafusion.v1.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.datafusion.v1.ICreateInstanceRequest, callback: google.cloud.datafusion.v1.DataFusion.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.datafusion.v1.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.datafusion.v1.IDeleteInstanceRequest, callback: google.cloud.datafusion.v1.DataFusion.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.datafusion.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.datafusion.v1.IUpdateInstanceRequest, callback: google.cloud.datafusion.v1.DataFusion.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.datafusion.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.datafusion.v1.IRestartInstanceRequest, callback: google.cloud.datafusion.v1.DataFusion.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.datafusion.v1.IRestartInstanceRequest): Promise; + } + + namespace DataFusion { + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listAvailableVersions}. + * @param error Error, if any + * @param [response] ListAvailableVersionsResponse + */ + type ListAvailableVersionsCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.ListAvailableVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig ipAllocation */ + ipAllocation?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig ipAllocation. */ + public ipAllocation: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.datafusion.v1.INetworkConfig): google.cloud.datafusion.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.datafusion.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.datafusion.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.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.datafusion.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.datafusion.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.datafusion.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.datafusion.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.datafusion.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version versionNumber */ + versionNumber?: (string|null); + + /** Version defaultVersion */ + defaultVersion?: (boolean|null); + + /** Version availableFeatures */ + availableFeatures?: (string[]|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IVersion); + + /** Version versionNumber. */ + public versionNumber: string; + + /** Version defaultVersion. */ + public defaultVersion: boolean; + + /** Version availableFeatures. */ + public availableFeatures: string[]; + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.datafusion.v1.IVersion): google.cloud.datafusion.v1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.datafusion.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @throws {Error} If the payload is not 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.datafusion.v1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @throws {Error} If the payload 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.datafusion.v1.Version; + + /** + * Verifies a Version message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator acceleratorType */ + acceleratorType?: (google.cloud.datafusion.v1.Accelerator.AcceleratorType|keyof typeof google.cloud.datafusion.v1.Accelerator.AcceleratorType|null); + + /** Accelerator state */ + state?: (google.cloud.datafusion.v1.Accelerator.State|keyof typeof google.cloud.datafusion.v1.Accelerator.State|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IAccelerator); + + /** Accelerator acceleratorType. */ + public acceleratorType: (google.cloud.datafusion.v1.Accelerator.AcceleratorType|keyof typeof google.cloud.datafusion.v1.Accelerator.AcceleratorType); + + /** Accelerator state. */ + public state: (google.cloud.datafusion.v1.Accelerator.State|keyof typeof google.cloud.datafusion.v1.Accelerator.State); + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.datafusion.v1.IAccelerator): google.cloud.datafusion.v1.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.datafusion.v1.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not 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.datafusion.v1.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload 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.datafusion.v1.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain 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 Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Accelerator { + + /** AcceleratorType enum. */ + enum AcceleratorType { + ACCELERATOR_TYPE_UNSPECIFIED = 0, + CDC = 1, + HEALTHCARE = 2, + CCAI_INSIGHTS = 3 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ENABLED = 1, + DISABLED = 2, + UNKNOWN = 3 + } + } + + /** Properties of a CryptoKeyConfig. */ + interface ICryptoKeyConfig { + + /** CryptoKeyConfig keyReference */ + keyReference?: (string|null); + } + + /** Represents a CryptoKeyConfig. */ + class CryptoKeyConfig implements ICryptoKeyConfig { + + /** + * Constructs a new CryptoKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.ICryptoKeyConfig); + + /** CryptoKeyConfig keyReference. */ + public keyReference: string; + + /** + * Creates a new CryptoKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKeyConfig instance + */ + public static create(properties?: google.cloud.datafusion.v1.ICryptoKeyConfig): google.cloud.datafusion.v1.CryptoKeyConfig; + + /** + * Encodes the specified CryptoKeyConfig message. Does not implicitly {@link google.cloud.datafusion.v1.CryptoKeyConfig.verify|verify} messages. + * @param message CryptoKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.ICryptoKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoKeyConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.CryptoKeyConfig.verify|verify} messages. + * @param message CryptoKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.ICryptoKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKeyConfig + * @throws {Error} If the payload is not 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.datafusion.v1.CryptoKeyConfig; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKeyConfig + * @throws {Error} If the payload 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.datafusion.v1.CryptoKeyConfig; + + /** + * Verifies a CryptoKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CryptoKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.CryptoKeyConfig; + + /** + * Creates a plain object from a CryptoKeyConfig message. Also converts values to other types if specified. + * @param message CryptoKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.CryptoKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance type */ + type?: (google.cloud.datafusion.v1.Instance.Type|keyof typeof google.cloud.datafusion.v1.Instance.Type|null); + + /** Instance enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** Instance enableStackdriverMonitoring */ + enableStackdriverMonitoring?: (boolean|null); + + /** Instance privateInstance */ + privateInstance?: (boolean|null); + + /** Instance networkConfig */ + networkConfig?: (google.cloud.datafusion.v1.INetworkConfig|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance options */ + options?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.datafusion.v1.Instance.State|keyof typeof google.cloud.datafusion.v1.Instance.State|null); + + /** Instance stateMessage */ + stateMessage?: (string|null); + + /** Instance serviceEndpoint */ + serviceEndpoint?: (string|null); + + /** Instance zone */ + zone?: (string|null); + + /** Instance version */ + version?: (string|null); + + /** Instance serviceAccount */ + serviceAccount?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance availableVersion */ + availableVersion?: (google.cloud.datafusion.v1.IVersion[]|null); + + /** Instance apiEndpoint */ + apiEndpoint?: (string|null); + + /** Instance gcsBucket */ + gcsBucket?: (string|null); + + /** Instance accelerators */ + accelerators?: (google.cloud.datafusion.v1.IAccelerator[]|null); + + /** Instance p4ServiceAccount */ + p4ServiceAccount?: (string|null); + + /** Instance tenantProjectId */ + tenantProjectId?: (string|null); + + /** Instance dataprocServiceAccount */ + dataprocServiceAccount?: (string|null); + + /** Instance enableRbac */ + enableRbac?: (boolean|null); + + /** Instance cryptoKeyConfig */ + cryptoKeyConfig?: (google.cloud.datafusion.v1.ICryptoKeyConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance type. */ + public type: (google.cloud.datafusion.v1.Instance.Type|keyof typeof google.cloud.datafusion.v1.Instance.Type); + + /** Instance enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** Instance enableStackdriverMonitoring. */ + public enableStackdriverMonitoring: boolean; + + /** Instance privateInstance. */ + public privateInstance: boolean; + + /** Instance networkConfig. */ + public networkConfig?: (google.cloud.datafusion.v1.INetworkConfig|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance options. */ + public options: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.datafusion.v1.Instance.State|keyof typeof google.cloud.datafusion.v1.Instance.State); + + /** Instance stateMessage. */ + public stateMessage: string; + + /** Instance serviceEndpoint. */ + public serviceEndpoint: string; + + /** Instance zone. */ + public zone: string; + + /** Instance version. */ + public version: string; + + /** Instance serviceAccount. */ + public serviceAccount: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance availableVersion. */ + public availableVersion: google.cloud.datafusion.v1.IVersion[]; + + /** Instance apiEndpoint. */ + public apiEndpoint: string; + + /** Instance gcsBucket. */ + public gcsBucket: string; + + /** Instance accelerators. */ + public accelerators: google.cloud.datafusion.v1.IAccelerator[]; + + /** Instance p4ServiceAccount. */ + public p4ServiceAccount: string; + + /** Instance tenantProjectId. */ + public tenantProjectId: string; + + /** Instance dataprocServiceAccount. */ + public dataprocServiceAccount: string; + + /** Instance enableRbac. */ + public enableRbac: boolean; + + /** Instance cryptoKeyConfig. */ + public cryptoKeyConfig?: (google.cloud.datafusion.v1.ICryptoKeyConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.datafusion.v1.IInstance): google.cloud.datafusion.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.datafusion.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not 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.datafusion.v1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload 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.datafusion.v1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + BASIC = 1, + ENTERPRISE = 2, + DEVELOPER = 3 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + FAILED = 3, + DELETING = 4, + UPGRADING = 5, + RESTARTING = 6, + UPDATING = 7, + AUTO_UPDATING = 8, + AUTO_UPGRADING = 9 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IListInstancesRequest): google.cloud.datafusion.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not 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.datafusion.v1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload 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.datafusion.v1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.datafusion.v1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.datafusion.v1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1.IListInstancesResponse): google.cloud.datafusion.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not 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.datafusion.v1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload 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.datafusion.v1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAvailableVersionsRequest. */ + interface IListAvailableVersionsRequest { + + /** ListAvailableVersionsRequest parent */ + parent?: (string|null); + + /** ListAvailableVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAvailableVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListAvailableVersionsRequest latestPatchOnly */ + latestPatchOnly?: (boolean|null); + } + + /** Represents a ListAvailableVersionsRequest. */ + class ListAvailableVersionsRequest implements IListAvailableVersionsRequest { + + /** + * Constructs a new ListAvailableVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IListAvailableVersionsRequest); + + /** ListAvailableVersionsRequest parent. */ + public parent: string; + + /** ListAvailableVersionsRequest pageSize. */ + public pageSize: number; + + /** ListAvailableVersionsRequest pageToken. */ + public pageToken: string; + + /** ListAvailableVersionsRequest latestPatchOnly. */ + public latestPatchOnly: boolean; + + /** + * Creates a new ListAvailableVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAvailableVersionsRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IListAvailableVersionsRequest): google.cloud.datafusion.v1.ListAvailableVersionsRequest; + + /** + * Encodes the specified ListAvailableVersionsRequest message. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsRequest.verify|verify} messages. + * @param message ListAvailableVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IListAvailableVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAvailableVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsRequest.verify|verify} messages. + * @param message ListAvailableVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IListAvailableVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAvailableVersionsRequest + * @throws {Error} If the payload is not 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.datafusion.v1.ListAvailableVersionsRequest; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAvailableVersionsRequest + * @throws {Error} If the payload 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.datafusion.v1.ListAvailableVersionsRequest; + + /** + * Verifies a ListAvailableVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAvailableVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAvailableVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.ListAvailableVersionsRequest; + + /** + * Creates a plain object from a ListAvailableVersionsRequest message. Also converts values to other types if specified. + * @param message ListAvailableVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.ListAvailableVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAvailableVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAvailableVersionsResponse. */ + interface IListAvailableVersionsResponse { + + /** ListAvailableVersionsResponse availableVersions */ + availableVersions?: (google.cloud.datafusion.v1.IVersion[]|null); + + /** ListAvailableVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAvailableVersionsResponse. */ + class ListAvailableVersionsResponse implements IListAvailableVersionsResponse { + + /** + * Constructs a new ListAvailableVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IListAvailableVersionsResponse); + + /** ListAvailableVersionsResponse availableVersions. */ + public availableVersions: google.cloud.datafusion.v1.IVersion[]; + + /** ListAvailableVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAvailableVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAvailableVersionsResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1.IListAvailableVersionsResponse): google.cloud.datafusion.v1.ListAvailableVersionsResponse; + + /** + * Encodes the specified ListAvailableVersionsResponse message. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsResponse.verify|verify} messages. + * @param message ListAvailableVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IListAvailableVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAvailableVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsResponse.verify|verify} messages. + * @param message ListAvailableVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IListAvailableVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAvailableVersionsResponse + * @throws {Error} If the payload is not 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.datafusion.v1.ListAvailableVersionsResponse; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAvailableVersionsResponse + * @throws {Error} If the payload 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.datafusion.v1.ListAvailableVersionsResponse; + + /** + * Verifies a ListAvailableVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAvailableVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAvailableVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.ListAvailableVersionsResponse; + + /** + * Creates a plain object from a ListAvailableVersionsResponse message. Also converts values to other types if specified. + * @param message ListAvailableVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.ListAvailableVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAvailableVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IGetInstanceRequest): google.cloud.datafusion.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.datafusion.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.datafusion.v1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.ICreateInstanceRequest): google.cloud.datafusion.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IDeleteInstanceRequest): google.cloud.datafusion.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.datafusion.v1.IInstance|null); + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.datafusion.v1.IInstance|null); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IUpdateInstanceRequest): google.cloud.datafusion.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1.IRestartInstanceRequest): google.cloud.datafusion.v1.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1.RestartInstanceRequest; + + /** + * Verifies a RestartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1.RestartInstanceRequest; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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 statusDetail */ + statusDetail?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata additionalStatus */ + additionalStatus?: ({ [k: string]: string }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.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 statusDetail. */ + public statusDetail: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata additionalStatus. */ + public additionalStatus: { [k: string]: string }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.datafusion.v1.IOperationMetadata): google.cloud.datafusion.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.datafusion.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.datafusion.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datafusion.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.datafusion.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.datafusion.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.datafusion.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.datafusion.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.datafusion.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a DataFusion */ + class DataFusion extends $protobuf.rpc.Service { + + /** + * Constructs a new DataFusion 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 DataFusion 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): DataFusion; + + /** + * Calls ListAvailableVersions. + * @param request ListAvailableVersionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAvailableVersionsResponse + */ + public listAvailableVersions(request: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersionsCallback): void; + + /** + * Calls ListAvailableVersions. + * @param request ListAvailableVersionsRequest message or plain object + * @returns Promise + */ + public listAvailableVersions(request: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest): Promise; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListInstancesResponse + */ + public listInstances(request: google.cloud.datafusion.v1beta1.IListInstancesRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.datafusion.v1beta1.IListInstancesRequest): Promise; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Instance + */ + public getInstance(request: google.cloud.datafusion.v1beta1.IGetInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.datafusion.v1beta1.IGetInstanceRequest): Promise; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createInstance(request: google.cloud.datafusion.v1beta1.ICreateInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.datafusion.v1beta1.ICreateInstanceRequest): Promise; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteInstance(request: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest): Promise; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateInstance(request: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest): Promise; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restartInstance(request: google.cloud.datafusion.v1beta1.IRestartInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.RestartInstanceCallback): void; + + /** + * Calls RestartInstance. + * @param request RestartInstanceRequest message or plain object + * @returns Promise + */ + public restartInstance(request: google.cloud.datafusion.v1beta1.IRestartInstanceRequest): Promise; + + /** + * Calls UpgradeInstance. + * @param request UpgradeInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public upgradeInstance(request: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstanceCallback): void; + + /** + * Calls UpgradeInstance. + * @param request UpgradeInstanceRequest message or plain object + * @returns Promise + */ + public upgradeInstance(request: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest): Promise; + + /** + * Calls RemoveIamPolicy. + * @param request RemoveIamPolicyRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RemoveIamPolicyResponse + */ + public removeIamPolicy(request: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicyCallback): void; + + /** + * Calls RemoveIamPolicy. + * @param request RemoveIamPolicyRequest message or plain object + * @returns Promise + */ + public removeIamPolicy(request: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest): Promise; + + /** + * Calls ListNamespaces. + * @param request ListNamespacesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListNamespacesResponse + */ + public listNamespaces(request: google.cloud.datafusion.v1beta1.IListNamespacesRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.ListNamespacesCallback): void; + + /** + * Calls ListNamespaces. + * @param request ListNamespacesRequest message or plain object + * @returns Promise + */ + public listNamespaces(request: google.cloud.datafusion.v1beta1.IListNamespacesRequest): Promise; + + /** + * Calls AddDnsPeering. + * @param request AddDnsPeeringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AddDnsPeeringResponse + */ + public addDnsPeering(request: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeeringCallback): void; + + /** + * Calls AddDnsPeering. + * @param request AddDnsPeeringRequest message or plain object + * @returns Promise + */ + public addDnsPeering(request: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest): Promise; + + /** + * Calls RemoveDnsPeering. + * @param request RemoveDnsPeeringRequest message or plain object + * @param callback Node-style callback called with the error, if any, and RemoveDnsPeeringResponse + */ + public removeDnsPeering(request: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeeringCallback): void; + + /** + * Calls RemoveDnsPeering. + * @param request RemoveDnsPeeringRequest message or plain object + * @returns Promise + */ + public removeDnsPeering(request: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest): Promise; + + /** + * Calls ListDnsPeerings. + * @param request ListDnsPeeringsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDnsPeeringsResponse + */ + public listDnsPeerings(request: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, callback: google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeeringsCallback): void; + + /** + * Calls ListDnsPeerings. + * @param request ListDnsPeeringsRequest message or plain object + * @returns Promise + */ + public listDnsPeerings(request: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest): Promise; + } + + namespace DataFusion { + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listAvailableVersions}. + * @param error Error, if any + * @param [response] ListAvailableVersionsResponse + */ + type ListAvailableVersionsCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#createInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#deleteInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#updateInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#restartInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#upgradeInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type UpgradeInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeIamPolicy}. + * @param error Error, if any + * @param [response] RemoveIamPolicyResponse + */ + type RemoveIamPolicyCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listNamespaces}. + * @param error Error, if any + * @param [response] ListNamespacesResponse + */ + type ListNamespacesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListNamespacesResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#addDnsPeering}. + * @param error Error, if any + * @param [response] AddDnsPeeringResponse + */ + type AddDnsPeeringCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.AddDnsPeeringResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeDnsPeering}. + * @param error Error, if any + * @param [response] RemoveDnsPeeringResponse + */ + type RemoveDnsPeeringCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse) => void; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listDnsPeerings}. + * @param error Error, if any + * @param [response] ListDnsPeeringsResponse + */ + type ListDnsPeeringsCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig ipAllocation */ + ipAllocation?: (string|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig ipAllocation. */ + public ipAllocation: string; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.INetworkConfig): google.cloud.datafusion.v1beta1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Version. */ + interface IVersion { + + /** Version versionNumber */ + versionNumber?: (string|null); + + /** Version defaultVersion */ + defaultVersion?: (boolean|null); + + /** Version availableFeatures */ + availableFeatures?: (string[]|null); + } + + /** Represents a Version. */ + class Version implements IVersion { + + /** + * Constructs a new Version. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IVersion); + + /** Version versionNumber. */ + public versionNumber: string; + + /** Version defaultVersion. */ + public defaultVersion: boolean; + + /** Version availableFeatures. */ + public availableFeatures: string[]; + + /** + * Creates a new Version instance using the specified properties. + * @param [properties] Properties to set + * @returns Version instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IVersion): google.cloud.datafusion.v1beta1.Version; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Version.verify|verify} messages. + * @param message Version message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IVersion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Version message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Version + * @throws {Error} If the payload is not 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.datafusion.v1beta1.Version; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Version + * @throws {Error} If the payload 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.datafusion.v1beta1.Version; + + /** + * Verifies a Version message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Version + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.Version; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @param message Version + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.Version, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Version to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Accelerator. */ + interface IAccelerator { + + /** Accelerator acceleratorType */ + acceleratorType?: (google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType|keyof typeof google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType|null); + } + + /** Represents an Accelerator. */ + class Accelerator implements IAccelerator { + + /** + * Constructs a new Accelerator. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IAccelerator); + + /** Accelerator acceleratorType. */ + public acceleratorType: (google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType|keyof typeof google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType); + + /** + * Creates a new Accelerator instance using the specified properties. + * @param [properties] Properties to set + * @returns Accelerator instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IAccelerator): google.cloud.datafusion.v1beta1.Accelerator; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Accelerator.verify|verify} messages. + * @param message Accelerator message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IAccelerator, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Accelerator + * @throws {Error} If the payload is not 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.datafusion.v1beta1.Accelerator; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Accelerator + * @throws {Error} If the payload 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.datafusion.v1beta1.Accelerator; + + /** + * Verifies an Accelerator message. + * @param message Plain 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 Accelerator message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Accelerator + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.Accelerator; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @param message Accelerator + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.Accelerator, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Accelerator to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Accelerator { + + /** AcceleratorType enum. */ + enum AcceleratorType { + ACCELERATOR_TYPE_UNSPECIFIED = 0, + CDC = 1, + HEALTHCARE = 2 + } + } + + /** Properties of a CryptoKeyConfig. */ + interface ICryptoKeyConfig { + + /** CryptoKeyConfig keyReference */ + keyReference?: (string|null); + } + + /** Represents a CryptoKeyConfig. */ + class CryptoKeyConfig implements ICryptoKeyConfig { + + /** + * Constructs a new CryptoKeyConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.ICryptoKeyConfig); + + /** CryptoKeyConfig keyReference. */ + public keyReference: string; + + /** + * Creates a new CryptoKeyConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CryptoKeyConfig instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.ICryptoKeyConfig): google.cloud.datafusion.v1beta1.CryptoKeyConfig; + + /** + * Encodes the specified CryptoKeyConfig message. Does not implicitly {@link google.cloud.datafusion.v1beta1.CryptoKeyConfig.verify|verify} messages. + * @param message CryptoKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.ICryptoKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CryptoKeyConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.CryptoKeyConfig.verify|verify} messages. + * @param message CryptoKeyConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.ICryptoKeyConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CryptoKeyConfig + * @throws {Error} If the payload is not 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.datafusion.v1beta1.CryptoKeyConfig; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CryptoKeyConfig + * @throws {Error} If the payload 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.datafusion.v1beta1.CryptoKeyConfig; + + /** + * Verifies a CryptoKeyConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CryptoKeyConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CryptoKeyConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.CryptoKeyConfig; + + /** + * Creates a plain object from a CryptoKeyConfig message. Also converts values to other types if specified. + * @param message CryptoKeyConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.CryptoKeyConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CryptoKeyConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance type */ + type?: (google.cloud.datafusion.v1beta1.Instance.Type|keyof typeof google.cloud.datafusion.v1beta1.Instance.Type|null); + + /** Instance enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + + /** Instance enableStackdriverMonitoring */ + enableStackdriverMonitoring?: (boolean|null); + + /** Instance privateInstance */ + privateInstance?: (boolean|null); + + /** Instance networkConfig */ + networkConfig?: (google.cloud.datafusion.v1beta1.INetworkConfig|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance options */ + options?: ({ [k: string]: string }|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state */ + state?: (google.cloud.datafusion.v1beta1.Instance.State|keyof typeof google.cloud.datafusion.v1beta1.Instance.State|null); + + /** Instance stateMessage */ + stateMessage?: (string|null); + + /** Instance serviceEndpoint */ + serviceEndpoint?: (string|null); + + /** Instance zone */ + zone?: (string|null); + + /** Instance version */ + version?: (string|null); + + /** Instance serviceAccount */ + serviceAccount?: (string|null); + + /** Instance displayName */ + displayName?: (string|null); + + /** Instance availableVersion */ + availableVersion?: (google.cloud.datafusion.v1beta1.IVersion[]|null); + + /** Instance apiEndpoint */ + apiEndpoint?: (string|null); + + /** Instance gcsBucket */ + gcsBucket?: (string|null); + + /** Instance accelerators */ + accelerators?: (google.cloud.datafusion.v1beta1.IAccelerator[]|null); + + /** Instance p4ServiceAccount */ + p4ServiceAccount?: (string|null); + + /** Instance tenantProjectId */ + tenantProjectId?: (string|null); + + /** Instance dataprocServiceAccount */ + dataprocServiceAccount?: (string|null); + + /** Instance enableRbac */ + enableRbac?: (boolean|null); + + /** Instance cryptoKeyConfig */ + cryptoKeyConfig?: (google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance type. */ + public type: (google.cloud.datafusion.v1beta1.Instance.Type|keyof typeof google.cloud.datafusion.v1beta1.Instance.Type); + + /** Instance enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** Instance enableStackdriverMonitoring. */ + public enableStackdriverMonitoring: boolean; + + /** Instance privateInstance. */ + public privateInstance: boolean; + + /** Instance networkConfig. */ + public networkConfig?: (google.cloud.datafusion.v1beta1.INetworkConfig|null); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance options. */ + public options: { [k: string]: string }; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Instance state. */ + public state: (google.cloud.datafusion.v1beta1.Instance.State|keyof typeof google.cloud.datafusion.v1beta1.Instance.State); + + /** Instance stateMessage. */ + public stateMessage: string; + + /** Instance serviceEndpoint. */ + public serviceEndpoint: string; + + /** Instance zone. */ + public zone: string; + + /** Instance version. */ + public version: string; + + /** Instance serviceAccount. */ + public serviceAccount: string; + + /** Instance displayName. */ + public displayName: string; + + /** Instance availableVersion. */ + public availableVersion: google.cloud.datafusion.v1beta1.IVersion[]; + + /** Instance apiEndpoint. */ + public apiEndpoint: string; + + /** Instance gcsBucket. */ + public gcsBucket: string; + + /** Instance accelerators. */ + public accelerators: google.cloud.datafusion.v1beta1.IAccelerator[]; + + /** Instance p4ServiceAccount. */ + public p4ServiceAccount: string; + + /** Instance tenantProjectId. */ + public tenantProjectId: string; + + /** Instance dataprocServiceAccount. */ + public dataprocServiceAccount: string; + + /** Instance enableRbac. */ + public enableRbac: boolean; + + /** Instance cryptoKeyConfig. */ + public cryptoKeyConfig?: (google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IInstance): google.cloud.datafusion.v1beta1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Instance.verify|verify} messages. + * @param message Instance message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Instance + * @throws {Error} If the payload is not 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.datafusion.v1beta1.Instance; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Instance + * @throws {Error} If the payload 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.datafusion.v1beta1.Instance; + + /** + * Verifies an Instance message. + * @param message Plain 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 Instance message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Instance + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.Instance; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @param message Instance + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + BASIC = 1, + ENTERPRISE = 2, + DEVELOPER = 3 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + RUNNING = 2, + FAILED = 3, + DELETING = 4, + UPGRADING = 5, + RESTARTING = 6, + UPDATING = 7, + AUTO_UPDATING = 8, + AUTO_UPGRADING = 9 + } + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListInstancesRequest): google.cloud.datafusion.v1beta1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesRequest.verify|verify} messages. + * @param message ListInstancesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListInstancesRequest; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.ListInstancesRequest; + + /** + * Verifies a ListInstancesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListInstancesRequest; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @param message ListInstancesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListInstancesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesResponse. */ + interface IListInstancesResponse { + + /** ListInstancesResponse instances */ + instances?: (google.cloud.datafusion.v1beta1.IInstance[]|null); + + /** ListInstancesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListInstancesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListInstancesResponse. */ + class ListInstancesResponse implements IListInstancesResponse { + + /** + * Constructs a new ListInstancesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.datafusion.v1beta1.IInstance[]; + + /** ListInstancesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListInstancesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListInstancesResponse): google.cloud.datafusion.v1beta1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesResponse.verify|verify} messages. + * @param message ListInstancesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListInstancesResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListInstancesResponse; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListInstancesResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.ListInstancesResponse; + + /** + * Verifies a ListInstancesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListInstancesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListInstancesResponse; + + /** + * Creates a plain object from a ListInstancesResponse message. Also converts values to other types if specified. + * @param message ListInstancesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAvailableVersionsRequest. */ + interface IListAvailableVersionsRequest { + + /** ListAvailableVersionsRequest parent */ + parent?: (string|null); + + /** ListAvailableVersionsRequest pageSize */ + pageSize?: (number|null); + + /** ListAvailableVersionsRequest pageToken */ + pageToken?: (string|null); + + /** ListAvailableVersionsRequest latestPatchOnly */ + latestPatchOnly?: (boolean|null); + } + + /** Represents a ListAvailableVersionsRequest. */ + class ListAvailableVersionsRequest implements IListAvailableVersionsRequest { + + /** + * Constructs a new ListAvailableVersionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest); + + /** ListAvailableVersionsRequest parent. */ + public parent: string; + + /** ListAvailableVersionsRequest pageSize. */ + public pageSize: number; + + /** ListAvailableVersionsRequest pageToken. */ + public pageToken: string; + + /** ListAvailableVersionsRequest latestPatchOnly. */ + public latestPatchOnly: boolean; + + /** + * Creates a new ListAvailableVersionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAvailableVersionsRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest): google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest; + + /** + * Encodes the specified ListAvailableVersionsRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest.verify|verify} messages. + * @param message ListAvailableVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAvailableVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest.verify|verify} messages. + * @param message ListAvailableVersionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAvailableVersionsRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListAvailableVersionsRequest; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAvailableVersionsRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.ListAvailableVersionsRequest; + + /** + * Verifies a ListAvailableVersionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAvailableVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAvailableVersionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest; + + /** + * Creates a plain object from a ListAvailableVersionsRequest message. Also converts values to other types if specified. + * @param message ListAvailableVersionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAvailableVersionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAvailableVersionsResponse. */ + interface IListAvailableVersionsResponse { + + /** ListAvailableVersionsResponse availableVersions */ + availableVersions?: (google.cloud.datafusion.v1beta1.IVersion[]|null); + + /** ListAvailableVersionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAvailableVersionsResponse. */ + class ListAvailableVersionsResponse implements IListAvailableVersionsResponse { + + /** + * Constructs a new ListAvailableVersionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse); + + /** ListAvailableVersionsResponse availableVersions. */ + public availableVersions: google.cloud.datafusion.v1beta1.IVersion[]; + + /** ListAvailableVersionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAvailableVersionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAvailableVersionsResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse): google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse; + + /** + * Encodes the specified ListAvailableVersionsResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.verify|verify} messages. + * @param message ListAvailableVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAvailableVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.verify|verify} messages. + * @param message ListAvailableVersionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAvailableVersionsResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListAvailableVersionsResponse; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAvailableVersionsResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.ListAvailableVersionsResponse; + + /** + * Verifies a ListAvailableVersionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAvailableVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAvailableVersionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse; + + /** + * Creates a plain object from a ListAvailableVersionsResponse message. Also converts values to other types if specified. + * @param message ListAvailableVersionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAvailableVersionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetInstanceRequest. */ + interface IGetInstanceRequest { + + /** GetInstanceRequest name */ + name?: (string|null); + } + + /** Represents a GetInstanceRequest. */ + class GetInstanceRequest implements IGetInstanceRequest { + + /** + * Constructs a new GetInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IGetInstanceRequest); + + /** GetInstanceRequest name. */ + public name: string; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IGetInstanceRequest): google.cloud.datafusion.v1beta1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.GetInstanceRequest.verify|verify} messages. + * @param message GetInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.GetInstanceRequest; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.GetInstanceRequest; + + /** + * Verifies a GetInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.GetInstanceRequest; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @param message GetInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.datafusion.v1beta1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.datafusion.v1beta1.IInstance|null); + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.ICreateInstanceRequest): google.cloud.datafusion.v1beta1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @param message CreateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.CreateInstanceRequest; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.CreateInstanceRequest; + + /** + * Verifies a CreateInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.CreateInstanceRequest; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @param message CreateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteInstanceRequest. */ + interface IDeleteInstanceRequest { + + /** DeleteInstanceRequest name */ + name?: (string|null); + } + + /** Represents a DeleteInstanceRequest. */ + class DeleteInstanceRequest implements IDeleteInstanceRequest { + + /** + * Constructs a new DeleteInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest); + + /** DeleteInstanceRequest name. */ + public name: string; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest): google.cloud.datafusion.v1beta1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @param message DeleteInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.DeleteInstanceRequest; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.DeleteInstanceRequest; + + /** + * Verifies a DeleteInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.DeleteInstanceRequest; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @param message DeleteInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.datafusion.v1beta1.IInstance|null); + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.datafusion.v1beta1.IInstance|null); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest): google.cloud.datafusion.v1beta1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @param message UpdateInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.UpdateInstanceRequest; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.UpdateInstanceRequest; + + /** + * Verifies an UpdateInstanceRequest message. + * @param message Plain 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 UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.UpdateInstanceRequest; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @param message UpdateInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestartInstanceRequest. */ + interface IRestartInstanceRequest { + + /** RestartInstanceRequest name */ + name?: (string|null); + } + + /** Represents a RestartInstanceRequest. */ + class RestartInstanceRequest implements IRestartInstanceRequest { + + /** + * Constructs a new RestartInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IRestartInstanceRequest); + + /** RestartInstanceRequest name. */ + public name: string; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestartInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IRestartInstanceRequest): google.cloud.datafusion.v1beta1.RestartInstanceRequest; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RestartInstanceRequest.verify|verify} messages. + * @param message RestartInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IRestartInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestartInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.RestartInstanceRequest; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestartInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.RestartInstanceRequest; + + /** + * Verifies a RestartInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestartInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.RestartInstanceRequest; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @param message RestartInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.RestartInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestartInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpgradeInstanceRequest. */ + interface IUpgradeInstanceRequest { + + /** UpgradeInstanceRequest name */ + name?: (string|null); + } + + /** Represents an UpgradeInstanceRequest. */ + class UpgradeInstanceRequest implements IUpgradeInstanceRequest { + + /** + * Constructs a new UpgradeInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest); + + /** UpgradeInstanceRequest name. */ + public name: string; + + /** + * Creates a new UpgradeInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpgradeInstanceRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest): google.cloud.datafusion.v1beta1.UpgradeInstanceRequest; + + /** + * Encodes the specified UpgradeInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpgradeInstanceRequest.verify|verify} messages. + * @param message UpgradeInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpgradeInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpgradeInstanceRequest.verify|verify} messages. + * @param message UpgradeInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpgradeInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpgradeInstanceRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.UpgradeInstanceRequest; + + /** + * Decodes an UpgradeInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpgradeInstanceRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.UpgradeInstanceRequest; + + /** + * Verifies an UpgradeInstanceRequest message. + * @param message Plain 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 UpgradeInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpgradeInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.UpgradeInstanceRequest; + + /** + * Creates a plain object from an UpgradeInstanceRequest message. Also converts values to other types if specified. + * @param message UpgradeInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.UpgradeInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpgradeInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** 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 statusDetail */ + statusDetail?: (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.datafusion.v1beta1.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 statusDetail. */ + public statusDetail: 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.datafusion.v1beta1.IOperationMetadata): google.cloud.datafusion.v1beta1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.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.datafusion.v1beta1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveIamPolicyRequest. */ + interface IRemoveIamPolicyRequest { + + /** RemoveIamPolicyRequest resource */ + resource?: (string|null); + } + + /** Represents a RemoveIamPolicyRequest. */ + class RemoveIamPolicyRequest implements IRemoveIamPolicyRequest { + + /** + * Constructs a new RemoveIamPolicyRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest); + + /** RemoveIamPolicyRequest resource. */ + public resource: string; + + /** + * Creates a new RemoveIamPolicyRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveIamPolicyRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest): google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest; + + /** + * Encodes the specified RemoveIamPolicyRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest.verify|verify} messages. + * @param message RemoveIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest.verify|verify} messages. + * @param message RemoveIamPolicyRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveIamPolicyRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveIamPolicyRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.RemoveIamPolicyRequest; + + /** + * Decodes a RemoveIamPolicyRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveIamPolicyRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.RemoveIamPolicyRequest; + + /** + * Verifies a RemoveIamPolicyRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveIamPolicyRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest; + + /** + * Creates a plain object from a RemoveIamPolicyRequest message. Also converts values to other types if specified. + * @param message RemoveIamPolicyRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveIamPolicyRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveIamPolicyResponse. */ + interface IRemoveIamPolicyResponse { + } + + /** Represents a RemoveIamPolicyResponse. */ + class RemoveIamPolicyResponse implements IRemoveIamPolicyResponse { + + /** + * Constructs a new RemoveIamPolicyResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse); + + /** + * Creates a new RemoveIamPolicyResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveIamPolicyResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse): google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse; + + /** + * Encodes the specified RemoveIamPolicyResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse.verify|verify} messages. + * @param message RemoveIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse.verify|verify} messages. + * @param message RemoveIamPolicyResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveIamPolicyResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveIamPolicyResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.RemoveIamPolicyResponse; + + /** + * Decodes a RemoveIamPolicyResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveIamPolicyResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.RemoveIamPolicyResponse; + + /** + * Verifies a RemoveIamPolicyResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveIamPolicyResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse; + + /** + * Creates a plain object from a RemoveIamPolicyResponse message. Also converts values to other types if specified. + * @param message RemoveIamPolicyResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveIamPolicyResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNamespacesRequest. */ + interface IListNamespacesRequest { + + /** ListNamespacesRequest parent */ + parent?: (string|null); + + /** ListNamespacesRequest pageSize */ + pageSize?: (number|null); + + /** ListNamespacesRequest pageToken */ + pageToken?: (string|null); + + /** ListNamespacesRequest view */ + view?: (google.cloud.datafusion.v1beta1.NamespaceView|keyof typeof google.cloud.datafusion.v1beta1.NamespaceView|null); + } + + /** Represents a ListNamespacesRequest. */ + class ListNamespacesRequest implements IListNamespacesRequest { + + /** + * Constructs a new ListNamespacesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListNamespacesRequest); + + /** ListNamespacesRequest parent. */ + public parent: string; + + /** ListNamespacesRequest pageSize. */ + public pageSize: number; + + /** ListNamespacesRequest pageToken. */ + public pageToken: string; + + /** ListNamespacesRequest view. */ + public view: (google.cloud.datafusion.v1beta1.NamespaceView|keyof typeof google.cloud.datafusion.v1beta1.NamespaceView); + + /** + * Creates a new ListNamespacesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNamespacesRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListNamespacesRequest): google.cloud.datafusion.v1beta1.ListNamespacesRequest; + + /** + * Encodes the specified ListNamespacesRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesRequest.verify|verify} messages. + * @param message ListNamespacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListNamespacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNamespacesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesRequest.verify|verify} messages. + * @param message ListNamespacesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListNamespacesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNamespacesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNamespacesRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListNamespacesRequest; + + /** + * Decodes a ListNamespacesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNamespacesRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.ListNamespacesRequest; + + /** + * Verifies a ListNamespacesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNamespacesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNamespacesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListNamespacesRequest; + + /** + * Creates a plain object from a ListNamespacesRequest message. Also converts values to other types if specified. + * @param message ListNamespacesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListNamespacesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNamespacesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a IAMPolicy. */ + interface IIAMPolicy { + + /** IAMPolicy policy */ + policy?: (google.iam.v1.IPolicy|null); + + /** IAMPolicy status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a IAMPolicy. */ + class IAMPolicy implements IIAMPolicy { + + /** + * Constructs a new IAMPolicy. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IIAMPolicy); + + /** IAMPolicy policy. */ + public policy?: (google.iam.v1.IPolicy|null); + + /** IAMPolicy status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new IAMPolicy instance using the specified properties. + * @param [properties] Properties to set + * @returns IAMPolicy instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IIAMPolicy): google.cloud.datafusion.v1beta1.IAMPolicy; + + /** + * Encodes the specified IAMPolicy message. Does not implicitly {@link google.cloud.datafusion.v1beta1.IAMPolicy.verify|verify} messages. + * @param message IAMPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IIAMPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified IAMPolicy message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.IAMPolicy.verify|verify} messages. + * @param message IAMPolicy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IIAMPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a IAMPolicy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns IAMPolicy + * @throws {Error} If the payload is not 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.datafusion.v1beta1.IAMPolicy; + + /** + * Decodes a IAMPolicy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns IAMPolicy + * @throws {Error} If the payload 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.datafusion.v1beta1.IAMPolicy; + + /** + * Verifies a IAMPolicy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a IAMPolicy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns IAMPolicy + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.IAMPolicy; + + /** + * Creates a plain object from a IAMPolicy message. Also converts values to other types if specified. + * @param message IAMPolicy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.IAMPolicy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this IAMPolicy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Namespace. */ + interface INamespace { + + /** Namespace name */ + name?: (string|null); + + /** Namespace iamPolicy */ + iamPolicy?: (google.cloud.datafusion.v1beta1.IIAMPolicy|null); + } + + /** Represents a Namespace. */ + class Namespace implements INamespace { + + /** + * Constructs a new Namespace. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.INamespace); + + /** Namespace name. */ + public name: string; + + /** Namespace iamPolicy. */ + public iamPolicy?: (google.cloud.datafusion.v1beta1.IIAMPolicy|null); + + /** + * Creates a new Namespace instance using the specified properties. + * @param [properties] Properties to set + * @returns Namespace instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.INamespace): google.cloud.datafusion.v1beta1.Namespace; + + /** + * Encodes the specified Namespace message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Namespace.verify|verify} messages. + * @param message Namespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.INamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Namespace message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Namespace.verify|verify} messages. + * @param message Namespace message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.INamespace, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Namespace message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Namespace + * @throws {Error} If the payload is not 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.datafusion.v1beta1.Namespace; + + /** + * Decodes a Namespace message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Namespace + * @throws {Error} If the payload 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.datafusion.v1beta1.Namespace; + + /** + * Verifies a Namespace message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Namespace message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Namespace + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.Namespace; + + /** + * Creates a plain object from a Namespace message. Also converts values to other types if specified. + * @param message Namespace + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.Namespace, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Namespace to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListNamespacesResponse. */ + interface IListNamespacesResponse { + + /** ListNamespacesResponse namespaces */ + namespaces?: (google.cloud.datafusion.v1beta1.INamespace[]|null); + + /** ListNamespacesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListNamespacesResponse. */ + class ListNamespacesResponse implements IListNamespacesResponse { + + /** + * Constructs a new ListNamespacesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListNamespacesResponse); + + /** ListNamespacesResponse namespaces. */ + public namespaces: google.cloud.datafusion.v1beta1.INamespace[]; + + /** ListNamespacesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListNamespacesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListNamespacesResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListNamespacesResponse): google.cloud.datafusion.v1beta1.ListNamespacesResponse; + + /** + * Encodes the specified ListNamespacesResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesResponse.verify|verify} messages. + * @param message ListNamespacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListNamespacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListNamespacesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesResponse.verify|verify} messages. + * @param message ListNamespacesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListNamespacesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListNamespacesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListNamespacesResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListNamespacesResponse; + + /** + * Decodes a ListNamespacesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListNamespacesResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.ListNamespacesResponse; + + /** + * Verifies a ListNamespacesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListNamespacesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListNamespacesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListNamespacesResponse; + + /** + * Creates a plain object from a ListNamespacesResponse message. Also converts values to other types if specified. + * @param message ListNamespacesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListNamespacesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListNamespacesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DnsPeering. */ + interface IDnsPeering { + + /** DnsPeering zone */ + zone?: (string|null); + + /** DnsPeering domain */ + domain?: (string|null); + + /** DnsPeering description */ + description?: (string|null); + + /** DnsPeering targetProject */ + targetProject?: (string|null); + + /** DnsPeering targetNetwork */ + targetNetwork?: (string|null); + } + + /** Represents a DnsPeering. */ + class DnsPeering implements IDnsPeering { + + /** + * Constructs a new DnsPeering. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IDnsPeering); + + /** DnsPeering zone. */ + public zone: string; + + /** DnsPeering domain. */ + public domain: string; + + /** DnsPeering description. */ + public description: string; + + /** DnsPeering targetProject. */ + public targetProject: string; + + /** DnsPeering targetNetwork. */ + public targetNetwork: string; + + /** + * Creates a new DnsPeering instance using the specified properties. + * @param [properties] Properties to set + * @returns DnsPeering instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IDnsPeering): google.cloud.datafusion.v1beta1.DnsPeering; + + /** + * Encodes the specified DnsPeering message. Does not implicitly {@link google.cloud.datafusion.v1beta1.DnsPeering.verify|verify} messages. + * @param message DnsPeering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IDnsPeering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DnsPeering message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.DnsPeering.verify|verify} messages. + * @param message DnsPeering message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IDnsPeering, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DnsPeering message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DnsPeering + * @throws {Error} If the payload is not 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.datafusion.v1beta1.DnsPeering; + + /** + * Decodes a DnsPeering message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DnsPeering + * @throws {Error} If the payload 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.datafusion.v1beta1.DnsPeering; + + /** + * Verifies a DnsPeering message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DnsPeering message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DnsPeering + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.DnsPeering; + + /** + * Creates a plain object from a DnsPeering message. Also converts values to other types if specified. + * @param message DnsPeering + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.DnsPeering, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DnsPeering to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddDnsPeeringRequest. */ + interface IAddDnsPeeringRequest { + + /** AddDnsPeeringRequest parent */ + parent?: (string|null); + + /** AddDnsPeeringRequest dnsPeering */ + dnsPeering?: (google.cloud.datafusion.v1beta1.IDnsPeering|null); + } + + /** Represents an AddDnsPeeringRequest. */ + class AddDnsPeeringRequest implements IAddDnsPeeringRequest { + + /** + * Constructs a new AddDnsPeeringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest); + + /** AddDnsPeeringRequest parent. */ + public parent: string; + + /** AddDnsPeeringRequest dnsPeering. */ + public dnsPeering?: (google.cloud.datafusion.v1beta1.IDnsPeering|null); + + /** + * Creates a new AddDnsPeeringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AddDnsPeeringRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest): google.cloud.datafusion.v1beta1.AddDnsPeeringRequest; + + /** + * Encodes the specified AddDnsPeeringRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringRequest.verify|verify} messages. + * @param message AddDnsPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddDnsPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringRequest.verify|verify} messages. + * @param message AddDnsPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddDnsPeeringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddDnsPeeringRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.AddDnsPeeringRequest; + + /** + * Decodes an AddDnsPeeringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddDnsPeeringRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.AddDnsPeeringRequest; + + /** + * Verifies an AddDnsPeeringRequest message. + * @param message Plain 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 AddDnsPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddDnsPeeringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.AddDnsPeeringRequest; + + /** + * Creates a plain object from an AddDnsPeeringRequest message. Also converts values to other types if specified. + * @param message AddDnsPeeringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.AddDnsPeeringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddDnsPeeringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AddDnsPeeringResponse. */ + interface IAddDnsPeeringResponse { + } + + /** Represents an AddDnsPeeringResponse. */ + class AddDnsPeeringResponse implements IAddDnsPeeringResponse { + + /** + * Constructs a new AddDnsPeeringResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse); + + /** + * Creates a new AddDnsPeeringResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AddDnsPeeringResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse): google.cloud.datafusion.v1beta1.AddDnsPeeringResponse; + + /** + * Encodes the specified AddDnsPeeringResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse.verify|verify} messages. + * @param message AddDnsPeeringResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AddDnsPeeringResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse.verify|verify} messages. + * @param message AddDnsPeeringResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AddDnsPeeringResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AddDnsPeeringResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.AddDnsPeeringResponse; + + /** + * Decodes an AddDnsPeeringResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AddDnsPeeringResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.AddDnsPeeringResponse; + + /** + * Verifies an AddDnsPeeringResponse message. + * @param message Plain 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 AddDnsPeeringResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AddDnsPeeringResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.AddDnsPeeringResponse; + + /** + * Creates a plain object from an AddDnsPeeringResponse message. Also converts values to other types if specified. + * @param message AddDnsPeeringResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.AddDnsPeeringResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AddDnsPeeringResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** NamespaceView enum. */ + enum NamespaceView { + NAMESPACE_VIEW_UNSPECIFIED = 0, + NAMESPACE_VIEW_BASIC = 1, + NAMESPACE_VIEW_FULL = 2 + } + + /** Properties of a RemoveDnsPeeringRequest. */ + interface IRemoveDnsPeeringRequest { + + /** RemoveDnsPeeringRequest parent */ + parent?: (string|null); + + /** RemoveDnsPeeringRequest zone */ + zone?: (string|null); + } + + /** Represents a RemoveDnsPeeringRequest. */ + class RemoveDnsPeeringRequest implements IRemoveDnsPeeringRequest { + + /** + * Constructs a new RemoveDnsPeeringRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest); + + /** RemoveDnsPeeringRequest parent. */ + public parent: string; + + /** RemoveDnsPeeringRequest zone. */ + public zone: string; + + /** + * Creates a new RemoveDnsPeeringRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveDnsPeeringRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest): google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest; + + /** + * Encodes the specified RemoveDnsPeeringRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest.verify|verify} messages. + * @param message RemoveDnsPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveDnsPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest.verify|verify} messages. + * @param message RemoveDnsPeeringRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveDnsPeeringRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveDnsPeeringRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.RemoveDnsPeeringRequest; + + /** + * Decodes a RemoveDnsPeeringRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveDnsPeeringRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.RemoveDnsPeeringRequest; + + /** + * Verifies a RemoveDnsPeeringRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveDnsPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveDnsPeeringRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest; + + /** + * Creates a plain object from a RemoveDnsPeeringRequest message. Also converts values to other types if specified. + * @param message RemoveDnsPeeringRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveDnsPeeringRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RemoveDnsPeeringResponse. */ + interface IRemoveDnsPeeringResponse { + } + + /** Represents a RemoveDnsPeeringResponse. */ + class RemoveDnsPeeringResponse implements IRemoveDnsPeeringResponse { + + /** + * Constructs a new RemoveDnsPeeringResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse); + + /** + * Creates a new RemoveDnsPeeringResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RemoveDnsPeeringResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse): google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse; + + /** + * Encodes the specified RemoveDnsPeeringResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse.verify|verify} messages. + * @param message RemoveDnsPeeringResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RemoveDnsPeeringResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse.verify|verify} messages. + * @param message RemoveDnsPeeringResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RemoveDnsPeeringResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RemoveDnsPeeringResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.RemoveDnsPeeringResponse; + + /** + * Decodes a RemoveDnsPeeringResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RemoveDnsPeeringResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.RemoveDnsPeeringResponse; + + /** + * Verifies a RemoveDnsPeeringResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RemoveDnsPeeringResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RemoveDnsPeeringResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse; + + /** + * Creates a plain object from a RemoveDnsPeeringResponse message. Also converts values to other types if specified. + * @param message RemoveDnsPeeringResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RemoveDnsPeeringResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDnsPeeringsRequest. */ + interface IListDnsPeeringsRequest { + + /** ListDnsPeeringsRequest parent */ + parent?: (string|null); + + /** ListDnsPeeringsRequest pageSize */ + pageSize?: (number|null); + + /** ListDnsPeeringsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDnsPeeringsRequest. */ + class ListDnsPeeringsRequest implements IListDnsPeeringsRequest { + + /** + * Constructs a new ListDnsPeeringsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest); + + /** ListDnsPeeringsRequest parent. */ + public parent: string; + + /** ListDnsPeeringsRequest pageSize. */ + public pageSize: number; + + /** ListDnsPeeringsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDnsPeeringsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsPeeringsRequest instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest): google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest; + + /** + * Encodes the specified ListDnsPeeringsRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest.verify|verify} messages. + * @param message ListDnsPeeringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsPeeringsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest.verify|verify} messages. + * @param message ListDnsPeeringsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsPeeringsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsPeeringsRequest + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListDnsPeeringsRequest; + + /** + * Decodes a ListDnsPeeringsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsPeeringsRequest + * @throws {Error} If the payload 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.datafusion.v1beta1.ListDnsPeeringsRequest; + + /** + * Verifies a ListDnsPeeringsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsPeeringsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsPeeringsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest; + + /** + * Creates a plain object from a ListDnsPeeringsRequest message. Also converts values to other types if specified. + * @param message ListDnsPeeringsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsPeeringsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDnsPeeringsResponse. */ + interface IListDnsPeeringsResponse { + + /** ListDnsPeeringsResponse dnsPeerings */ + dnsPeerings?: (google.cloud.datafusion.v1beta1.IDnsPeering[]|null); + + /** ListDnsPeeringsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDnsPeeringsResponse. */ + class ListDnsPeeringsResponse implements IListDnsPeeringsResponse { + + /** + * Constructs a new ListDnsPeeringsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse); + + /** ListDnsPeeringsResponse dnsPeerings. */ + public dnsPeerings: google.cloud.datafusion.v1beta1.IDnsPeering[]; + + /** ListDnsPeeringsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDnsPeeringsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDnsPeeringsResponse instance + */ + public static create(properties?: google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse): google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse; + + /** + * Encodes the specified ListDnsPeeringsResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.verify|verify} messages. + * @param message ListDnsPeeringsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDnsPeeringsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.verify|verify} messages. + * @param message ListDnsPeeringsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDnsPeeringsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDnsPeeringsResponse + * @throws {Error} If the payload is not 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.datafusion.v1beta1.ListDnsPeeringsResponse; + + /** + * Decodes a ListDnsPeeringsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDnsPeeringsResponse + * @throws {Error} If the payload 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.datafusion.v1beta1.ListDnsPeeringsResponse; + + /** + * Verifies a ListDnsPeeringsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDnsPeeringsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDnsPeeringsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse; + + /** + * Creates a plain object from a ListDnsPeeringsResponse message. Also converts values to other types if specified. + * @param message ListDnsPeeringsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDnsPeeringsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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); + } + + /** 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; + + /** + * 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + /** 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 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 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 }; + } + + 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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 }; + } + } + + /** 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 }; + } + + 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); + } + + /** 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; + + /** + * 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + + /** 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 }; + } + } + + /** 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 }; + } + } + + /** Namespace iam. */ + namespace iam { + + /** Namespace v1. */ + namespace v1 { + + /** Properties of a Policy. */ + interface IPolicy { + + /** Policy version */ + version?: (number|null); + + /** Policy bindings */ + bindings?: (google.iam.v1.IBinding[]|null); + + /** Policy etag */ + etag?: (Uint8Array|string|null); + } + + /** Represents a Policy. */ + class Policy implements IPolicy { + + /** + * Constructs a new Policy. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicy); + + /** Policy version. */ + public version: number; + + /** Policy bindings. */ + public bindings: google.iam.v1.IBinding[]; + + /** Policy etag. */ + public etag: (Uint8Array|string); + + /** + * Creates a new Policy instance using the specified properties. + * @param [properties] Properties to set + * @returns Policy instance + */ + public static create(properties?: google.iam.v1.IPolicy): google.iam.v1.Policy; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @param message Policy message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicy, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Policy; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Policy; + + /** + * Verifies a Policy message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Policy + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Policy; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @param message Policy + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Policy, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Policy to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Binding. */ + interface IBinding { + + /** Binding role */ + role?: (string|null); + + /** Binding members */ + members?: (string[]|null); + + /** Binding condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a Binding. */ + class Binding implements IBinding { + + /** + * Constructs a new Binding. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBinding); + + /** Binding role. */ + public role: string; + + /** Binding members. */ + public members: string[]; + + /** Binding condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new Binding instance using the specified properties. + * @param [properties] Properties to set + * @returns Binding instance + */ + public static create(properties?: google.iam.v1.IBinding): google.iam.v1.Binding; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @param message Binding message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBinding, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.Binding; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.Binding; + + /** + * Verifies a Binding message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Binding + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.Binding; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @param message Binding + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.Binding, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Binding to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PolicyDelta. */ + interface IPolicyDelta { + + /** PolicyDelta bindingDeltas */ + bindingDeltas?: (google.iam.v1.IBindingDelta[]|null); + + /** PolicyDelta auditConfigDeltas */ + auditConfigDeltas?: (google.iam.v1.IAuditConfigDelta[]|null); + } + + /** Represents a PolicyDelta. */ + class PolicyDelta implements IPolicyDelta { + + /** + * Constructs a new PolicyDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IPolicyDelta); + + /** PolicyDelta bindingDeltas. */ + public bindingDeltas: google.iam.v1.IBindingDelta[]; + + /** PolicyDelta auditConfigDeltas. */ + public auditConfigDeltas: google.iam.v1.IAuditConfigDelta[]; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns PolicyDelta instance + */ + public static create(properties?: google.iam.v1.IPolicyDelta): google.iam.v1.PolicyDelta; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @param message PolicyDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IPolicyDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.PolicyDelta; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.PolicyDelta; + + /** + * Verifies a PolicyDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PolicyDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.PolicyDelta; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @param message PolicyDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.PolicyDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PolicyDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BindingDelta. */ + interface IBindingDelta { + + /** BindingDelta action */ + action?: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action|null); + + /** BindingDelta role */ + role?: (string|null); + + /** BindingDelta member */ + member?: (string|null); + + /** BindingDelta condition */ + condition?: (google.type.IExpr|null); + } + + /** Represents a BindingDelta. */ + class BindingDelta implements IBindingDelta { + + /** + * Constructs a new BindingDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IBindingDelta); + + /** BindingDelta action. */ + public action: (google.iam.v1.BindingDelta.Action|keyof typeof google.iam.v1.BindingDelta.Action); + + /** BindingDelta role. */ + public role: string; + + /** BindingDelta member. */ + public member: string; + + /** BindingDelta condition. */ + public condition?: (google.type.IExpr|null); + + /** + * Creates a new BindingDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns BindingDelta instance + */ + public static create(properties?: google.iam.v1.IBindingDelta): google.iam.v1.BindingDelta; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @param message BindingDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IBindingDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.BindingDelta; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.BindingDelta; + + /** + * Verifies a BindingDelta message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BindingDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.BindingDelta; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @param message BindingDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.BindingDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BindingDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BindingDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + + /** Properties of an AuditConfigDelta. */ + interface IAuditConfigDelta { + + /** AuditConfigDelta action */ + action?: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action|null); + + /** AuditConfigDelta service */ + service?: (string|null); + + /** AuditConfigDelta exemptedMember */ + exemptedMember?: (string|null); + + /** AuditConfigDelta logType */ + logType?: (string|null); + } + + /** Represents an AuditConfigDelta. */ + class AuditConfigDelta implements IAuditConfigDelta { + + /** + * Constructs a new AuditConfigDelta. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfigDelta); + + /** AuditConfigDelta action. */ + public action: (google.iam.v1.AuditConfigDelta.Action|keyof typeof google.iam.v1.AuditConfigDelta.Action); + + /** AuditConfigDelta service. */ + public service: string; + + /** AuditConfigDelta exemptedMember. */ + public exemptedMember: string; + + /** AuditConfigDelta logType. */ + public logType: string; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfigDelta instance + */ + public static create(properties?: google.iam.v1.IAuditConfigDelta): google.iam.v1.AuditConfigDelta; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @param message AuditConfigDelta message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfigDelta, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfigDelta; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfigDelta; + + /** + * Verifies an AuditConfigDelta message. + * @param message Plain 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 AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfigDelta + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfigDelta; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @param message AuditConfigDelta + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfigDelta, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfigDelta to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AuditConfigDelta { + + /** Action enum. */ + enum Action { + ACTION_UNSPECIFIED = 0, + ADD = 1, + REMOVE = 2 + } + } + } + } + + /** Namespace type. */ + namespace type { + + /** Properties of an Expr. */ + interface IExpr { + + /** Expr expression */ + expression?: (string|null); + + /** Expr title */ + title?: (string|null); + + /** Expr description */ + description?: (string|null); + + /** Expr location */ + location?: (string|null); + } + + /** Represents an Expr. */ + class Expr implements IExpr { + + /** + * Constructs a new Expr. + * @param [properties] Properties to set + */ + constructor(properties?: google.type.IExpr); + + /** Expr expression. */ + public expression: string; + + /** Expr title. */ + public title: string; + + /** Expr description. */ + public description: string; + + /** Expr location. */ + public location: string; + + /** + * Creates a new Expr instance using the specified properties. + * @param [properties] Properties to set + * @returns Expr instance + */ + public static create(properties?: google.type.IExpr): google.type.Expr; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @param message Expr message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.type.IExpr, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.type.Expr; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.type.Expr; + + /** + * Verifies an Expr message. + * @param message Plain 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 Expr message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Expr + */ + public static fromObject(object: { [k: string]: any }): google.type.Expr; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @param message Expr + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.type.Expr, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Expr to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } +} diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js new file mode 100644 index 00000000000..635b203bc5a --- /dev/null +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -0,0 +1,27686 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +/*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").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_data_fusion_protos || ($protobuf.roots._google_cloud_data_fusion_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.datafusion = (function() { + + /** + * Namespace datafusion. + * @memberof google.cloud + * @namespace + */ + var datafusion = {}; + + datafusion.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.datafusion + * @namespace + */ + var v1 = {}; + + v1.DataFusion = (function() { + + /** + * Constructs a new DataFusion service. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a DataFusion + * @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 DataFusion(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataFusion.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataFusion; + + /** + * Creates new DataFusion service using the specified rpc implementation. + * @function create + * @memberof google.cloud.datafusion.v1.DataFusion + * @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 {DataFusion} RPC service. Useful where requests and/or responses are streamed. + */ + DataFusion.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listAvailableVersions}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef ListAvailableVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1.ListAvailableVersionsResponse} [response] ListAvailableVersionsResponse + */ + + /** + * Calls ListAvailableVersions. + * @function listAvailableVersions + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest} request ListAvailableVersionsRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.ListAvailableVersionsCallback} callback Node-style callback called with the error, if any, and ListAvailableVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listAvailableVersions = function listAvailableVersions(request, callback) { + return this.rpcCall(listAvailableVersions, $root.google.cloud.datafusion.v1.ListAvailableVersionsRequest, $root.google.cloud.datafusion.v1.ListAvailableVersionsResponse, request, callback); + }, "name", { value: "ListAvailableVersions" }); + + /** + * Calls ListAvailableVersions. + * @function listAvailableVersions + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest} request ListAvailableVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listInstances}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.datafusion.v1.ListInstancesRequest, $root.google.cloud.datafusion.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#getInstance}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.datafusion.v1.GetInstanceRequest, $root.google.cloud.datafusion.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#createInstance}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.datafusion.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#deleteInstance}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.datafusion.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#updateInstance}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.datafusion.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#restartInstance}. + * @memberof google.cloud.datafusion.v1.DataFusion + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1.DataFusion.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.datafusion.v1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.datafusion.v1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataFusion; + })(); + + v1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.datafusion.v1 + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [ipAllocation] NetworkConfig ipAllocation + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.datafusion.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 network. + * @member {string} network + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig ipAllocation. + * @member {string} ipAllocation + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.ipAllocation = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @static + * @param {google.cloud.datafusion.v1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.datafusion.v1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @static + * @param {google.cloud.datafusion.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.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.ipAllocation != null && Object.hasOwnProperty.call(message, "ipAllocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAllocation); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @static + * @param {google.cloud.datafusion.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.datafusion.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.datafusion.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.datafusion.v1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.network = reader.string(); + break; + case 2: + message.ipAllocation = reader.string(); + 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.datafusion.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.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.datafusion.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.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.ipAllocation != null && message.hasOwnProperty("ipAllocation")) + if (!$util.isString(message.ipAllocation)) + return "ipAllocation: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.NetworkConfig) + return object; + var message = new $root.google.cloud.datafusion.v1.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.ipAllocation != null) + message.ipAllocation = String(object.ipAllocation); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @static + * @param {google.cloud.datafusion.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.network = ""; + object.ipAllocation = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.ipAllocation != null && message.hasOwnProperty("ipAllocation")) + object.ipAllocation = message.ipAllocation; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkConfig; + })(); + + v1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.datafusion.v1 + * @interface IVersion + * @property {string|null} [versionNumber] Version versionNumber + * @property {boolean|null} [defaultVersion] Version defaultVersion + * @property {Array.|null} [availableFeatures] Version availableFeatures + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.datafusion.v1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.availableFeatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version versionNumber. + * @member {string} versionNumber + * @memberof google.cloud.datafusion.v1.Version + * @instance + */ + Version.prototype.versionNumber = ""; + + /** + * Version defaultVersion. + * @member {boolean} defaultVersion + * @memberof google.cloud.datafusion.v1.Version + * @instance + */ + Version.prototype.defaultVersion = false; + + /** + * Version availableFeatures. + * @member {Array.} availableFeatures + * @memberof google.cloud.datafusion.v1.Version + * @instance + */ + Version.prototype.availableFeatures = $util.emptyArray; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {google.cloud.datafusion.v1.IVersion=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.datafusion.v1.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {google.cloud.datafusion.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.versionNumber); + if (message.defaultVersion != null && Object.hasOwnProperty.call(message, "defaultVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultVersion); + if (message.availableFeatures != null && message.availableFeatures.length) + for (var i = 0; i < message.availableFeatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableFeatures[i]); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {google.cloud.datafusion.v1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function 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.datafusion.v1.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionNumber = reader.string(); + break; + case 2: + message.defaultVersion = reader.bool(); + break; + case 3: + if (!(message.availableFeatures && message.availableFeatures.length)) + message.availableFeatures = []; + message.availableFeatures.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isString(message.versionNumber)) + return "versionNumber: string expected"; + if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) + if (typeof message.defaultVersion !== "boolean") + return "defaultVersion: boolean expected"; + if (message.availableFeatures != null && message.hasOwnProperty("availableFeatures")) { + if (!Array.isArray(message.availableFeatures)) + return "availableFeatures: array expected"; + for (var i = 0; i < message.availableFeatures.length; ++i) + if (!$util.isString(message.availableFeatures[i])) + return "availableFeatures: string[] expected"; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.Version) + return object; + var message = new $root.google.cloud.datafusion.v1.Version(); + if (object.versionNumber != null) + message.versionNumber = String(object.versionNumber); + if (object.defaultVersion != null) + message.defaultVersion = Boolean(object.defaultVersion); + if (object.availableFeatures) { + if (!Array.isArray(object.availableFeatures)) + throw TypeError(".google.cloud.datafusion.v1.Version.availableFeatures: array expected"); + message.availableFeatures = []; + for (var i = 0; i < object.availableFeatures.length; ++i) + message.availableFeatures[i] = String(object.availableFeatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {google.cloud.datafusion.v1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableFeatures = []; + if (options.defaults) { + object.versionNumber = ""; + object.defaultVersion = false; + } + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) + object.defaultVersion = message.defaultVersion; + if (message.availableFeatures && message.availableFeatures.length) { + object.availableFeatures = []; + for (var j = 0; j < message.availableFeatures.length; ++j) + object.availableFeatures[j] = message.availableFeatures[j]; + } + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Version; + })(); + + v1.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.datafusion.v1 + * @interface IAccelerator + * @property {google.cloud.datafusion.v1.Accelerator.AcceleratorType|null} [acceleratorType] Accelerator acceleratorType + * @property {google.cloud.datafusion.v1.Accelerator.State|null} [state] Accelerator state + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.datafusion.v1.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator acceleratorType. + * @member {google.cloud.datafusion.v1.Accelerator.AcceleratorType} acceleratorType + * @memberof google.cloud.datafusion.v1.Accelerator + * @instance + */ + Accelerator.prototype.acceleratorType = 0; + + /** + * Accelerator state. + * @member {google.cloud.datafusion.v1.Accelerator.State} state + * @memberof google.cloud.datafusion.v1.Accelerator + * @instance + */ + Accelerator.prototype.state = 0; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {google.cloud.datafusion.v1.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.datafusion.v1.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {google.cloud.datafusion.v1.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.acceleratorType); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.state); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {google.cloud.datafusion.v1.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function 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.datafusion.v1.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceleratorType = reader.int32(); + break; + case 2: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + switch (message.acceleratorType) { + default: + return "acceleratorType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + 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 an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.Accelerator) + return object; + var message = new $root.google.cloud.datafusion.v1.Accelerator(); + switch (object.acceleratorType) { + case "ACCELERATOR_TYPE_UNSPECIFIED": + case 0: + message.acceleratorType = 0; + break; + case "CDC": + case 1: + message.acceleratorType = 1; + break; + case "HEALTHCARE": + case 2: + message.acceleratorType = 2; + break; + case "CCAI_INSIGHTS": + case 3: + message.acceleratorType = 3; + break; + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "ENABLED": + case 1: + message.state = 1; + break; + case "DISABLED": + case 2: + message.state = 2; + break; + case "UNKNOWN": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {google.cloud.datafusion.v1.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + } + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.State[message.state] : message.state; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AcceleratorType enum. + * @name google.cloud.datafusion.v1.Accelerator.AcceleratorType + * @enum {number} + * @property {number} ACCELERATOR_TYPE_UNSPECIFIED=0 ACCELERATOR_TYPE_UNSPECIFIED value + * @property {number} CDC=1 CDC value + * @property {number} HEALTHCARE=2 HEALTHCARE value + * @property {number} CCAI_INSIGHTS=3 CCAI_INSIGHTS value + */ + Accelerator.AcceleratorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCELERATOR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CDC"] = 1; + values[valuesById[2] = "HEALTHCARE"] = 2; + values[valuesById[3] = "CCAI_INSIGHTS"] = 3; + return values; + })(); + + /** + * State enum. + * @name google.cloud.datafusion.v1.Accelerator.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ENABLED=1 ENABLED value + * @property {number} DISABLED=2 DISABLED value + * @property {number} UNKNOWN=3 UNKNOWN value + */ + Accelerator.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENABLED"] = 1; + values[valuesById[2] = "DISABLED"] = 2; + values[valuesById[3] = "UNKNOWN"] = 3; + return values; + })(); + + return Accelerator; + })(); + + v1.CryptoKeyConfig = (function() { + + /** + * Properties of a CryptoKeyConfig. + * @memberof google.cloud.datafusion.v1 + * @interface ICryptoKeyConfig + * @property {string|null} [keyReference] CryptoKeyConfig keyReference + */ + + /** + * Constructs a new CryptoKeyConfig. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a CryptoKeyConfig. + * @implements ICryptoKeyConfig + * @constructor + * @param {google.cloud.datafusion.v1.ICryptoKeyConfig=} [properties] Properties to set + */ + function CryptoKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoKeyConfig keyReference. + * @member {string} keyReference + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @instance + */ + CryptoKeyConfig.prototype.keyReference = ""; + + /** + * Creates a new CryptoKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1.ICryptoKeyConfig=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.CryptoKeyConfig} CryptoKeyConfig instance + */ + CryptoKeyConfig.create = function create(properties) { + return new CryptoKeyConfig(properties); + }; + + /** + * Encodes the specified CryptoKeyConfig message. Does not implicitly {@link google.cloud.datafusion.v1.CryptoKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1.ICryptoKeyConfig} message CryptoKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyReference != null && Object.hasOwnProperty.call(message, "keyReference")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyReference); + return writer; + }; + + /** + * Encodes the specified CryptoKeyConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.CryptoKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1.ICryptoKeyConfig} message CryptoKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.CryptoKeyConfig} CryptoKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyConfig.decode = function 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.datafusion.v1.CryptoKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyReference = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.CryptoKeyConfig} CryptoKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoKeyConfig message. + * @function verify + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyReference != null && message.hasOwnProperty("keyReference")) + if (!$util.isString(message.keyReference)) + return "keyReference: string expected"; + return null; + }; + + /** + * Creates a CryptoKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.CryptoKeyConfig} CryptoKeyConfig + */ + CryptoKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.CryptoKeyConfig) + return object; + var message = new $root.google.cloud.datafusion.v1.CryptoKeyConfig(); + if (object.keyReference != null) + message.keyReference = String(object.keyReference); + return message; + }; + + /** + * Creates a plain object from a CryptoKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1.CryptoKeyConfig} message CryptoKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyReference = ""; + if (message.keyReference != null && message.hasOwnProperty("keyReference")) + object.keyReference = message.keyReference; + return object; + }; + + /** + * Converts this CryptoKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @instance + * @returns {Object.} JSON object + */ + CryptoKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CryptoKeyConfig; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.datafusion.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {google.cloud.datafusion.v1.Instance.Type|null} [type] Instance type + * @property {boolean|null} [enableStackdriverLogging] Instance enableStackdriverLogging + * @property {boolean|null} [enableStackdriverMonitoring] Instance enableStackdriverMonitoring + * @property {boolean|null} [privateInstance] Instance privateInstance + * @property {google.cloud.datafusion.v1.INetworkConfig|null} [networkConfig] Instance networkConfig + * @property {Object.|null} [labels] Instance labels + * @property {Object.|null} [options] Instance options + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.datafusion.v1.Instance.State|null} [state] Instance state + * @property {string|null} [stateMessage] Instance stateMessage + * @property {string|null} [serviceEndpoint] Instance serviceEndpoint + * @property {string|null} [zone] Instance zone + * @property {string|null} [version] Instance version + * @property {string|null} [serviceAccount] Instance serviceAccount + * @property {string|null} [displayName] Instance displayName + * @property {Array.|null} [availableVersion] Instance availableVersion + * @property {string|null} [apiEndpoint] Instance apiEndpoint + * @property {string|null} [gcsBucket] Instance gcsBucket + * @property {Array.|null} [accelerators] Instance accelerators + * @property {string|null} [p4ServiceAccount] Instance p4ServiceAccount + * @property {string|null} [tenantProjectId] Instance tenantProjectId + * @property {string|null} [dataprocServiceAccount] Instance dataprocServiceAccount + * @property {boolean|null} [enableRbac] Instance enableRbac + * @property {google.cloud.datafusion.v1.ICryptoKeyConfig|null} [cryptoKeyConfig] Instance cryptoKeyConfig + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.datafusion.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.options = {}; + this.availableVersion = []; + this.accelerators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance type. + * @member {google.cloud.datafusion.v1.Instance.Type} type + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.type = 0; + + /** + * Instance enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.enableStackdriverLogging = false; + + /** + * Instance enableStackdriverMonitoring. + * @member {boolean} enableStackdriverMonitoring + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.enableStackdriverMonitoring = false; + + /** + * Instance privateInstance. + * @member {boolean} privateInstance + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.privateInstance = false; + + /** + * Instance networkConfig. + * @member {google.cloud.datafusion.v1.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.networkConfig = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance options. + * @member {Object.} options + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.options = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.datafusion.v1.Instance.State} state + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.stateMessage = ""; + + /** + * Instance serviceEndpoint. + * @member {string} serviceEndpoint + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.serviceEndpoint = ""; + + /** + * Instance zone. + * @member {string} zone + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.zone = ""; + + /** + * Instance version. + * @member {string} version + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.version = ""; + + /** + * Instance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.serviceAccount = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance availableVersion. + * @member {Array.} availableVersion + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.availableVersion = $util.emptyArray; + + /** + * Instance apiEndpoint. + * @member {string} apiEndpoint + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.apiEndpoint = ""; + + /** + * Instance gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.gcsBucket = ""; + + /** + * Instance accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.accelerators = $util.emptyArray; + + /** + * Instance p4ServiceAccount. + * @member {string} p4ServiceAccount + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.p4ServiceAccount = ""; + + /** + * Instance tenantProjectId. + * @member {string} tenantProjectId + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.tenantProjectId = ""; + + /** + * Instance dataprocServiceAccount. + * @member {string} dataprocServiceAccount + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.dataprocServiceAccount = ""; + + /** + * Instance enableRbac. + * @member {boolean} enableRbac + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.enableRbac = false; + + /** + * Instance cryptoKeyConfig. + * @member {google.cloud.datafusion.v1.ICryptoKeyConfig|null|undefined} cryptoKeyConfig + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.cryptoKeyConfig = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {google.cloud.datafusion.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.datafusion.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {google.cloud.datafusion.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableStackdriverLogging); + if (message.enableStackdriverMonitoring != null && Object.hasOwnProperty.call(message, "enableStackdriverMonitoring")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableStackdriverMonitoring); + if (message.privateInstance != null && Object.hasOwnProperty.call(message, "privateInstance")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.privateInstance); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.datafusion.v1.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + for (var keys = Object.keys(message.options), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.options[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.stateMessage); + if (message.serviceEndpoint != null && Object.hasOwnProperty.call(message, "serviceEndpoint")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.serviceEndpoint); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.zone); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.version); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.serviceAccount); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.displayName); + if (message.availableVersion != null && message.availableVersion.length) + for (var i = 0; i < message.availableVersion.length; ++i) + $root.google.cloud.datafusion.v1.Version.encode(message.availableVersion[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.apiEndpoint != null && Object.hasOwnProperty.call(message, "apiEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.apiEndpoint); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.gcsBucket); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.datafusion.v1.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.p4ServiceAccount != null && Object.hasOwnProperty.call(message, "p4ServiceAccount")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.p4ServiceAccount); + if (message.tenantProjectId != null && Object.hasOwnProperty.call(message, "tenantProjectId")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.tenantProjectId); + if (message.dataprocServiceAccount != null && Object.hasOwnProperty.call(message, "dataprocServiceAccount")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.dataprocServiceAccount); + if (message.enableRbac != null && Object.hasOwnProperty.call(message, "enableRbac")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.enableRbac); + if (message.cryptoKeyConfig != null && Object.hasOwnProperty.call(message, "cryptoKeyConfig")) + $root.google.cloud.datafusion.v1.CryptoKeyConfig.encode(message.cryptoKeyConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {google.cloud.datafusion.v1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function 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.datafusion.v1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.type = reader.int32(); + break; + case 4: + message.enableStackdriverLogging = reader.bool(); + break; + case 5: + message.enableStackdriverMonitoring = reader.bool(); + break; + case 6: + message.privateInstance = reader.bool(); + break; + case 7: + message.networkConfig = $root.google.cloud.datafusion.v1.NetworkConfig.decode(reader, reader.uint32()); + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 9: + if (message.options === $util.emptyObject) + message.options = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.options[key] = value; + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.state = reader.int32(); + break; + case 13: + message.stateMessage = reader.string(); + break; + case 14: + message.serviceEndpoint = reader.string(); + break; + case 15: + message.zone = reader.string(); + break; + case 16: + message.version = reader.string(); + break; + case 17: + message.serviceAccount = reader.string(); + break; + case 18: + message.displayName = reader.string(); + break; + case 19: + if (!(message.availableVersion && message.availableVersion.length)) + message.availableVersion = []; + message.availableVersion.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); + break; + case 20: + message.apiEndpoint = reader.string(); + break; + case 21: + message.gcsBucket = reader.string(); + break; + case 22: + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.datafusion.v1.Accelerator.decode(reader, reader.uint32())); + break; + case 23: + message.p4ServiceAccount = reader.string(); + break; + case 24: + message.tenantProjectId = reader.string(); + break; + case 25: + message.dataprocServiceAccount = reader.string(); + break; + case 27: + message.enableRbac = reader.bool(); + break; + case 28: + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) + if (typeof message.enableStackdriverMonitoring !== "boolean") + return "enableStackdriverMonitoring: boolean expected"; + if (message.privateInstance != null && message.hasOwnProperty("privateInstance")) + if (typeof message.privateInstance !== "boolean") + return "privateInstance: boolean expected"; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.datafusion.v1.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!$util.isObject(message.options)) + return "options: object expected"; + var key = Object.keys(message.options); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.options[key[i]])) + return "options: string{k: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: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + if (!$util.isString(message.serviceEndpoint)) + return "serviceEndpoint: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.availableVersion != null && message.hasOwnProperty("availableVersion")) { + if (!Array.isArray(message.availableVersion)) + return "availableVersion: array expected"; + for (var i = 0; i < message.availableVersion.length; ++i) { + var error = $root.google.cloud.datafusion.v1.Version.verify(message.availableVersion[i]); + if (error) + return "availableVersion." + error; + } + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) + if (!$util.isString(message.apiEndpoint)) + return "apiEndpoint: string expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.datafusion.v1.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.p4ServiceAccount != null && message.hasOwnProperty("p4ServiceAccount")) + if (!$util.isString(message.p4ServiceAccount)) + return "p4ServiceAccount: string expected"; + if (message.tenantProjectId != null && message.hasOwnProperty("tenantProjectId")) + if (!$util.isString(message.tenantProjectId)) + return "tenantProjectId: string expected"; + if (message.dataprocServiceAccount != null && message.hasOwnProperty("dataprocServiceAccount")) + if (!$util.isString(message.dataprocServiceAccount)) + return "dataprocServiceAccount: string expected"; + if (message.enableRbac != null && message.hasOwnProperty("enableRbac")) + if (typeof message.enableRbac !== "boolean") + return "enableRbac: boolean expected"; + if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) { + var error = $root.google.cloud.datafusion.v1.CryptoKeyConfig.verify(message.cryptoKeyConfig); + if (error) + return "cryptoKeyConfig." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.Instance) + return object; + var message = new $root.google.cloud.datafusion.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BASIC": + case 1: + message.type = 1; + break; + case "ENTERPRISE": + case 2: + message.type = 2; + break; + case "DEVELOPER": + case 3: + message.type = 3; + break; + } + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableStackdriverMonitoring != null) + message.enableStackdriverMonitoring = Boolean(object.enableStackdriverMonitoring); + if (object.privateInstance != null) + message.privateInstance = Boolean(object.privateInstance); + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.datafusion.v1.NetworkConfig.fromObject(object.networkConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.options) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.options: object expected"); + message.options = {}; + for (var keys = Object.keys(object.options), i = 0; i < keys.length; ++i) + message.options[keys[i]] = String(object.options[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.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.datafusion.v1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + 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 "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UPGRADING": + case 5: + message.state = 5; + break; + case "RESTARTING": + case 6: + message.state = 6; + break; + case "UPDATING": + case 7: + message.state = 7; + break; + case "AUTO_UPDATING": + case 8: + message.state = 8; + break; + case "AUTO_UPGRADING": + case 9: + message.state = 9; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.serviceEndpoint != null) + message.serviceEndpoint = String(object.serviceEndpoint); + if (object.zone != null) + message.zone = String(object.zone); + if (object.version != null) + message.version = String(object.version); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.availableVersion) { + if (!Array.isArray(object.availableVersion)) + throw TypeError(".google.cloud.datafusion.v1.Instance.availableVersion: array expected"); + message.availableVersion = []; + for (var i = 0; i < object.availableVersion.length; ++i) { + if (typeof object.availableVersion[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.availableVersion: object expected"); + message.availableVersion[i] = $root.google.cloud.datafusion.v1.Version.fromObject(object.availableVersion[i]); + } + } + if (object.apiEndpoint != null) + message.apiEndpoint = String(object.apiEndpoint); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.datafusion.v1.Instance.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.datafusion.v1.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.p4ServiceAccount != null) + message.p4ServiceAccount = String(object.p4ServiceAccount); + if (object.tenantProjectId != null) + message.tenantProjectId = String(object.tenantProjectId); + if (object.dataprocServiceAccount != null) + message.dataprocServiceAccount = String(object.dataprocServiceAccount); + if (object.enableRbac != null) + message.enableRbac = Boolean(object.enableRbac); + if (object.cryptoKeyConfig != null) { + if (typeof object.cryptoKeyConfig !== "object") + throw TypeError(".google.cloud.datafusion.v1.Instance.cryptoKeyConfig: object expected"); + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.fromObject(object.cryptoKeyConfig); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {google.cloud.datafusion.v1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.availableVersion = []; + object.accelerators = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.options = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.enableStackdriverLogging = false; + object.enableStackdriverMonitoring = false; + object.privateInstance = false; + object.networkConfig = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.serviceEndpoint = ""; + object.zone = ""; + object.version = ""; + object.serviceAccount = ""; + object.displayName = ""; + object.apiEndpoint = ""; + object.gcsBucket = ""; + object.p4ServiceAccount = ""; + object.tenantProjectId = ""; + object.dataprocServiceAccount = ""; + object.enableRbac = false; + object.cryptoKeyConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.Type[message.type] : message.type; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) + object.enableStackdriverMonitoring = message.enableStackdriverMonitoring; + if (message.privateInstance != null && message.hasOwnProperty("privateInstance")) + object.privateInstance = message.privateInstance; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.datafusion.v1.NetworkConfig.toObject(message.networkConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.options && (keys2 = Object.keys(message.options)).length) { + object.options = {}; + for (var j = 0; j < keys2.length; ++j) + object.options[keys2[j]] = message.options[keys2[j]]; + } + 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.datafusion.v1.Instance.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + object.serviceEndpoint = message.serviceEndpoint; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.availableVersion && message.availableVersion.length) { + object.availableVersion = []; + for (var j = 0; j < message.availableVersion.length; ++j) + object.availableVersion[j] = $root.google.cloud.datafusion.v1.Version.toObject(message.availableVersion[j], options); + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) + object.apiEndpoint = message.apiEndpoint; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.datafusion.v1.Accelerator.toObject(message.accelerators[j], options); + } + if (message.p4ServiceAccount != null && message.hasOwnProperty("p4ServiceAccount")) + object.p4ServiceAccount = message.p4ServiceAccount; + if (message.tenantProjectId != null && message.hasOwnProperty("tenantProjectId")) + object.tenantProjectId = message.tenantProjectId; + if (message.dataprocServiceAccount != null && message.hasOwnProperty("dataprocServiceAccount")) + object.dataprocServiceAccount = message.dataprocServiceAccount; + if (message.enableRbac != null && message.hasOwnProperty("enableRbac")) + object.enableRbac = message.enableRbac; + if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) + object.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.toObject(message.cryptoKeyConfig, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.datafusion.v1.Instance.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} ENTERPRISE=2 ENTERPRISE value + * @property {number} DEVELOPER=3 DEVELOPER value + */ + Instance.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "ENTERPRISE"] = 2; + values[valuesById[3] = "DEVELOPER"] = 3; + return values; + })(); + + /** + * State enum. + * @name google.cloud.datafusion.v1.Instance.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} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + * @property {number} UPGRADING=5 UPGRADING value + * @property {number} RESTARTING=6 RESTARTING value + * @property {number} UPDATING=7 UPDATING value + * @property {number} AUTO_UPDATING=8 AUTO_UPDATING value + * @property {number} AUTO_UPGRADING=9 AUTO_UPGRADING value + */ + Instance.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] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UPGRADING"] = 5; + values[valuesById[6] = "RESTARTING"] = 6; + values[valuesById[7] = "UPDATING"] = 7; + values[valuesById[8] = "AUTO_UPDATING"] = 8; + values[valuesById[9] = "AUTO_UPGRADING"] = 9; + return values; + })(); + + return Instance; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.datafusion.v1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.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 ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function 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.datafusion.v1.ListInstancesRequest(); + 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 ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.ListInstancesRequest(); + 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 ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.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 ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.datafusion.v1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.datafusion.v1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + 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]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.datafusion.v1.Instance.encode(message.instances[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 ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function 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.datafusion.v1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.datafusion.v1.Instance.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 ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.datafusion.v1.Instance.verify(message.instances[i]); + if (error) + return "instances." + 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.datafusion.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.datafusion.v1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.datafusion.v1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.datafusion.v1.ListInstancesResponse.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 ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.datafusion.v1.Instance.toObject(message.instances[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 ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1.ListAvailableVersionsRequest = (function() { + + /** + * Properties of a ListAvailableVersionsRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IListAvailableVersionsRequest + * @property {string|null} [parent] ListAvailableVersionsRequest parent + * @property {number|null} [pageSize] ListAvailableVersionsRequest pageSize + * @property {string|null} [pageToken] ListAvailableVersionsRequest pageToken + * @property {boolean|null} [latestPatchOnly] ListAvailableVersionsRequest latestPatchOnly + */ + + /** + * Constructs a new ListAvailableVersionsRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a ListAvailableVersionsRequest. + * @implements IListAvailableVersionsRequest + * @constructor + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest=} [properties] Properties to set + */ + function ListAvailableVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAvailableVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.parent = ""; + + /** + * ListAvailableVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.pageSize = 0; + + /** + * ListAvailableVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.pageToken = ""; + + /** + * ListAvailableVersionsRequest latestPatchOnly. + * @member {boolean} latestPatchOnly + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.latestPatchOnly = false; + + /** + * Creates a new ListAvailableVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsRequest} ListAvailableVersionsRequest instance + */ + ListAvailableVersionsRequest.create = function create(properties) { + return new ListAvailableVersionsRequest(properties); + }; + + /** + * Encodes the specified ListAvailableVersionsRequest message. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest} message ListAvailableVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsRequest.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.latestPatchOnly != null && Object.hasOwnProperty.call(message, "latestPatchOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestPatchOnly); + return writer; + }; + + /** + * Encodes the specified ListAvailableVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsRequest} message ListAvailableVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsRequest.decode = function 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.datafusion.v1.ListAvailableVersionsRequest(); + 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.latestPatchOnly = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAvailableVersionsRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAvailableVersionsRequest.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.latestPatchOnly != null && message.hasOwnProperty("latestPatchOnly")) + if (typeof message.latestPatchOnly !== "boolean") + return "latestPatchOnly: boolean expected"; + return null; + }; + + /** + * Creates a ListAvailableVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + */ + ListAvailableVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.ListAvailableVersionsRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.ListAvailableVersionsRequest(); + 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.latestPatchOnly != null) + message.latestPatchOnly = Boolean(object.latestPatchOnly); + return message; + }; + + /** + * Creates a plain object from a ListAvailableVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1.ListAvailableVersionsRequest} message ListAvailableVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAvailableVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.latestPatchOnly = false; + } + 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.latestPatchOnly != null && message.hasOwnProperty("latestPatchOnly")) + object.latestPatchOnly = message.latestPatchOnly; + return object; + }; + + /** + * Converts this ListAvailableVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAvailableVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAvailableVersionsRequest; + })(); + + v1.ListAvailableVersionsResponse = (function() { + + /** + * Properties of a ListAvailableVersionsResponse. + * @memberof google.cloud.datafusion.v1 + * @interface IListAvailableVersionsResponse + * @property {Array.|null} [availableVersions] ListAvailableVersionsResponse availableVersions + * @property {string|null} [nextPageToken] ListAvailableVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListAvailableVersionsResponse. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a ListAvailableVersionsResponse. + * @implements IListAvailableVersionsResponse + * @constructor + * @param {google.cloud.datafusion.v1.IListAvailableVersionsResponse=} [properties] Properties to set + */ + function ListAvailableVersionsResponse(properties) { + this.availableVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAvailableVersionsResponse availableVersions. + * @member {Array.} availableVersions + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @instance + */ + ListAvailableVersionsResponse.prototype.availableVersions = $util.emptyArray; + + /** + * ListAvailableVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @instance + */ + ListAvailableVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAvailableVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsResponse} ListAvailableVersionsResponse instance + */ + ListAvailableVersionsResponse.create = function create(properties) { + return new ListAvailableVersionsResponse(properties); + }; + + /** + * Encodes the specified ListAvailableVersionsResponse message. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsResponse} message ListAvailableVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableVersions != null && message.availableVersions.length) + for (var i = 0; i < message.availableVersions.length; ++i) + $root.google.cloud.datafusion.v1.Version.encode(message.availableVersions[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 ListAvailableVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.ListAvailableVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1.IListAvailableVersionsResponse} message ListAvailableVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsResponse.decode = function 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.datafusion.v1.ListAvailableVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.availableVersions && message.availableVersions.length)) + message.availableVersions = []; + message.availableVersions.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAvailableVersionsResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAvailableVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableVersions != null && message.hasOwnProperty("availableVersions")) { + if (!Array.isArray(message.availableVersions)) + return "availableVersions: array expected"; + for (var i = 0; i < message.availableVersions.length; ++i) { + var error = $root.google.cloud.datafusion.v1.Version.verify(message.availableVersions[i]); + if (error) + return "availableVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAvailableVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + */ + ListAvailableVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.ListAvailableVersionsResponse) + return object; + var message = new $root.google.cloud.datafusion.v1.ListAvailableVersionsResponse(); + if (object.availableVersions) { + if (!Array.isArray(object.availableVersions)) + throw TypeError(".google.cloud.datafusion.v1.ListAvailableVersionsResponse.availableVersions: array expected"); + message.availableVersions = []; + for (var i = 0; i < object.availableVersions.length; ++i) { + if (typeof object.availableVersions[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1.ListAvailableVersionsResponse.availableVersions: object expected"); + message.availableVersions[i] = $root.google.cloud.datafusion.v1.Version.fromObject(object.availableVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAvailableVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1.ListAvailableVersionsResponse} message ListAvailableVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAvailableVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.availableVersions && message.availableVersions.length) { + object.availableVersions = []; + for (var j = 0; j < message.availableVersions.length; ++j) + object.availableVersions[j] = $root.google.cloud.datafusion.v1.Version.toObject(message.availableVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAvailableVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAvailableVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAvailableVersionsResponse; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function 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.datafusion.v1.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.datafusion.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.datafusion.v1.IInstance|null|undefined} instance + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.datafusion.v1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function 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.datafusion.v1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.instanceId = reader.string(); + break; + case 3: + message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.datafusion.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.datafusion.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.datafusion.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.datafusion.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function 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.datafusion.v1.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IUpdateInstanceRequest + * @property {google.cloud.datafusion.v1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.datafusion.v1.IInstance|null|undefined} instance + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.datafusion.v1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function 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.datafusion.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.datafusion.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.UpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.datafusion.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.datafusion.v1.Instance.fromObject(object.instance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.datafusion.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.updateMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.datafusion.v1.Instance.toObject(message.instance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1.RestartInstanceRequest = (function() { + + /** + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + */ + + /** + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.RestartInstanceRequest} RestartInstanceRequest instance + */ + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); + }; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1.RestartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.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 RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.RestartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decode = function 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.datafusion.v1.RestartInstanceRequest(); + 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 RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartInstanceRequest.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 RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.RestartInstanceRequest} RestartInstanceRequest + */ + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.RestartInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1.RestartInstanceRequest} message RestartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartInstanceRequest.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 RestartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestartInstanceRequest; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.datafusion.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} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @property {Object.|null} [additionalStatus] OperationMetadata additionalStatus + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.datafusion.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.datafusion.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.additionalStatus = {}; + if (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.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * OperationMetadata additionalStatus. + * @member {Object.} additionalStatus + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.additionalStatus = $util.emptyObject; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @static + * @param {google.cloud.datafusion.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.datafusion.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @static + * @param {google.cloud.datafusion.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.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + 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); + if (message.additionalStatus != null && Object.hasOwnProperty.call(message, "additionalStatus")) + for (var keys = Object.keys(message.additionalStatus), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.additionalStatus[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @static + * @param {google.cloud.datafusion.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.datafusion.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.datafusion.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.datafusion.v1.OperationMetadata(), key, value; + 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.statusDetail = reader.string(); + break; + case 6: + message.requestedCancellation = reader.bool(); + break; + case 7: + message.apiVersion = reader.string(); + break; + case 8: + if (message.additionalStatus === $util.emptyObject) + message.additionalStatus = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.additionalStatus[key] = value; + 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.datafusion.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.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.datafusion.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.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: 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"; + if (message.additionalStatus != null && message.hasOwnProperty("additionalStatus")) { + if (!$util.isObject(message.additionalStatus)) + return "additionalStatus: object expected"; + var key = Object.keys(message.additionalStatus); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.additionalStatus[key[i]])) + return "additionalStatus: string{k: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.datafusion.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.datafusion.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datafusion.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.datafusion.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.statusDetail != null) + message.statusDetail = String(object.statusDetail); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + if (object.additionalStatus) { + if (typeof object.additionalStatus !== "object") + throw TypeError(".google.cloud.datafusion.v1.OperationMetadata.additionalStatus: object expected"); + message.additionalStatus = {}; + for (var keys = Object.keys(object.additionalStatus), i = 0; i < keys.length; ++i) + message.additionalStatus[keys[i]] = String(object.additionalStatus[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @static + * @param {google.cloud.datafusion.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.objects || options.defaults) + object.additionalStatus = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusDetail = ""; + 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.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + var keys2; + if (message.additionalStatus && (keys2 = Object.keys(message.additionalStatus)).length) { + object.additionalStatus = {}; + for (var j = 0; j < keys2.length; ++j) + object.additionalStatus[keys2[j]] = message.additionalStatus[keys2[j]]; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + return v1; + })(); + + datafusion.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.datafusion + * @namespace + */ + var v1beta1 = {}; + + v1beta1.DataFusion = (function() { + + /** + * Constructs a new DataFusion service. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a DataFusion + * @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 DataFusion(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (DataFusion.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = DataFusion; + + /** + * Creates new DataFusion service using the specified rpc implementation. + * @function create + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @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 {DataFusion} RPC service. Useful where requests and/or responses are streamed. + */ + DataFusion.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listAvailableVersions}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef ListAvailableVersionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} [response] ListAvailableVersionsResponse + */ + + /** + * Calls ListAvailableVersions. + * @function listAvailableVersions + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest} request ListAvailableVersionsRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersionsCallback} callback Node-style callback called with the error, if any, and ListAvailableVersionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listAvailableVersions = function listAvailableVersions(request, callback) { + return this.rpcCall(listAvailableVersions, $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest, $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse, request, callback); + }, "name", { value: "ListAvailableVersions" }); + + /** + * Calls ListAvailableVersions. + * @function listAvailableVersions + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest} request ListAvailableVersionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listInstances}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.datafusion.v1beta1.ListInstancesRequest, $root.google.cloud.datafusion.v1beta1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#getInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.datafusion.v1beta1.GetInstanceRequest, $root.google.cloud.datafusion.v1beta1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#createInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.datafusion.v1beta1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#deleteInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.datafusion.v1beta1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#updateInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.datafusion.v1beta1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#restartInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef RestartInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.RestartInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.restartInstance = function restartInstance(request, callback) { + return this.rpcCall(restartInstance, $root.google.cloud.datafusion.v1beta1.RestartInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestartInstance" }); + + /** + * Calls RestartInstance. + * @function restartInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest} request RestartInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#upgradeInstance}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef UpgradeInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpgradeInstance. + * @function upgradeInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest} request UpgradeInstanceRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.upgradeInstance = function upgradeInstance(request, callback) { + return this.rpcCall(upgradeInstance, $root.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpgradeInstance" }); + + /** + * Calls UpgradeInstance. + * @function upgradeInstance + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest} request UpgradeInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeIamPolicy}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef RemoveIamPolicyCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} [response] RemoveIamPolicyResponse + */ + + /** + * Calls RemoveIamPolicy. + * @function removeIamPolicy + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest} request RemoveIamPolicyRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicyCallback} callback Node-style callback called with the error, if any, and RemoveIamPolicyResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.removeIamPolicy = function removeIamPolicy(request, callback) { + return this.rpcCall(removeIamPolicy, $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest, $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse, request, callback); + }, "name", { value: "RemoveIamPolicy" }); + + /** + * Calls RemoveIamPolicy. + * @function removeIamPolicy + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest} request RemoveIamPolicyRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listNamespaces}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef ListNamespacesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.ListNamespacesResponse} [response] ListNamespacesResponse + */ + + /** + * Calls ListNamespaces. + * @function listNamespaces + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest} request ListNamespacesRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.ListNamespacesCallback} callback Node-style callback called with the error, if any, and ListNamespacesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listNamespaces = function listNamespaces(request, callback) { + return this.rpcCall(listNamespaces, $root.google.cloud.datafusion.v1beta1.ListNamespacesRequest, $root.google.cloud.datafusion.v1beta1.ListNamespacesResponse, request, callback); + }, "name", { value: "ListNamespaces" }); + + /** + * Calls ListNamespaces. + * @function listNamespaces + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest} request ListNamespacesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#addDnsPeering}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef AddDnsPeeringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} [response] AddDnsPeeringResponse + */ + + /** + * Calls AddDnsPeering. + * @function addDnsPeering + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest} request AddDnsPeeringRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeeringCallback} callback Node-style callback called with the error, if any, and AddDnsPeeringResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.addDnsPeering = function addDnsPeering(request, callback) { + return this.rpcCall(addDnsPeering, $root.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest, $root.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse, request, callback); + }, "name", { value: "AddDnsPeering" }); + + /** + * Calls AddDnsPeering. + * @function addDnsPeering + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest} request AddDnsPeeringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeDnsPeering}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef RemoveDnsPeeringCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} [response] RemoveDnsPeeringResponse + */ + + /** + * Calls RemoveDnsPeering. + * @function removeDnsPeering + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest} request RemoveDnsPeeringRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeeringCallback} callback Node-style callback called with the error, if any, and RemoveDnsPeeringResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.removeDnsPeering = function removeDnsPeering(request, callback) { + return this.rpcCall(removeDnsPeering, $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest, $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse, request, callback); + }, "name", { value: "RemoveDnsPeering" }); + + /** + * Calls RemoveDnsPeering. + * @function removeDnsPeering + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest} request RemoveDnsPeeringRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listDnsPeerings}. + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @typedef ListDnsPeeringsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} [response] ListDnsPeeringsResponse + */ + + /** + * Calls ListDnsPeerings. + * @function listDnsPeerings + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest} request ListDnsPeeringsRequest message or plain object + * @param {google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeeringsCallback} callback Node-style callback called with the error, if any, and ListDnsPeeringsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(DataFusion.prototype.listDnsPeerings = function listDnsPeerings(request, callback) { + return this.rpcCall(listDnsPeerings, $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest, $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse, request, callback); + }, "name", { value: "ListDnsPeerings" }); + + /** + * Calls ListDnsPeerings. + * @function listDnsPeerings + * @memberof google.cloud.datafusion.v1beta1.DataFusion + * @instance + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest} request ListDnsPeeringsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return DataFusion; + })(); + + v1beta1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.datafusion.v1beta1 + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {string|null} [ipAllocation] NetworkConfig ipAllocation + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.datafusion.v1beta1.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 network. + * @member {string} network + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig ipAllocation. + * @member {string} ipAllocation + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.ipAllocation = ""; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @static + * @param {google.cloud.datafusion.v1beta1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.datafusion.v1beta1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @static + * @param {google.cloud.datafusion.v1beta1.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.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.ipAllocation != null && Object.hasOwnProperty.call(message, "ipAllocation")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ipAllocation); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @static + * @param {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.network = reader.string(); + break; + case 2: + message.ipAllocation = reader.string(); + 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.datafusion.v1beta1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.ipAllocation != null && message.hasOwnProperty("ipAllocation")) + if (!$util.isString(message.ipAllocation)) + return "ipAllocation: string expected"; + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.NetworkConfig) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.ipAllocation != null) + message.ipAllocation = String(object.ipAllocation); + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @static + * @param {google.cloud.datafusion.v1beta1.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.network = ""; + object.ipAllocation = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.ipAllocation != null && message.hasOwnProperty("ipAllocation")) + object.ipAllocation = message.ipAllocation; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkConfig; + })(); + + v1beta1.Version = (function() { + + /** + * Properties of a Version. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IVersion + * @property {string|null} [versionNumber] Version versionNumber + * @property {boolean|null} [defaultVersion] Version defaultVersion + * @property {Array.|null} [availableFeatures] Version availableFeatures + */ + + /** + * Constructs a new Version. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a Version. + * @implements IVersion + * @constructor + * @param {google.cloud.datafusion.v1beta1.IVersion=} [properties] Properties to set + */ + function Version(properties) { + this.availableFeatures = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Version versionNumber. + * @member {string} versionNumber + * @memberof google.cloud.datafusion.v1beta1.Version + * @instance + */ + Version.prototype.versionNumber = ""; + + /** + * Version defaultVersion. + * @member {boolean} defaultVersion + * @memberof google.cloud.datafusion.v1beta1.Version + * @instance + */ + Version.prototype.defaultVersion = false; + + /** + * Version availableFeatures. + * @member {Array.} availableFeatures + * @memberof google.cloud.datafusion.v1beta1.Version + * @instance + */ + Version.prototype.availableFeatures = $util.emptyArray; + + /** + * Creates a new Version instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {google.cloud.datafusion.v1beta1.IVersion=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.Version} Version instance + */ + Version.create = function create(properties) { + return new Version(properties); + }; + + /** + * Encodes the specified Version message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Version.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {google.cloud.datafusion.v1beta1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.versionNumber != null && Object.hasOwnProperty.call(message, "versionNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.versionNumber); + if (message.defaultVersion != null && Object.hasOwnProperty.call(message, "defaultVersion")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.defaultVersion); + if (message.availableFeatures != null && message.availableFeatures.length) + for (var i = 0; i < message.availableFeatures.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableFeatures[i]); + return writer; + }; + + /** + * Encodes the specified Version message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Version.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {google.cloud.datafusion.v1beta1.IVersion} message Version message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Version.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Version message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decode = function 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.datafusion.v1beta1.Version(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.versionNumber = reader.string(); + break; + case 2: + message.defaultVersion = reader.bool(); + break; + case 3: + if (!(message.availableFeatures && message.availableFeatures.length)) + message.availableFeatures = []; + message.availableFeatures.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Version message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.Version} Version + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Version.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Version message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Version.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + if (!$util.isString(message.versionNumber)) + return "versionNumber: string expected"; + if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) + if (typeof message.defaultVersion !== "boolean") + return "defaultVersion: boolean expected"; + if (message.availableFeatures != null && message.hasOwnProperty("availableFeatures")) { + if (!Array.isArray(message.availableFeatures)) + return "availableFeatures: array expected"; + for (var i = 0; i < message.availableFeatures.length; ++i) + if (!$util.isString(message.availableFeatures[i])) + return "availableFeatures: string[] expected"; + } + return null; + }; + + /** + * Creates a Version message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.Version} Version + */ + Version.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.Version) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.Version(); + if (object.versionNumber != null) + message.versionNumber = String(object.versionNumber); + if (object.defaultVersion != null) + message.defaultVersion = Boolean(object.defaultVersion); + if (object.availableFeatures) { + if (!Array.isArray(object.availableFeatures)) + throw TypeError(".google.cloud.datafusion.v1beta1.Version.availableFeatures: array expected"); + message.availableFeatures = []; + for (var i = 0; i < object.availableFeatures.length; ++i) + message.availableFeatures[i] = String(object.availableFeatures[i]); + } + return message; + }; + + /** + * Creates a plain object from a Version message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {google.cloud.datafusion.v1beta1.Version} message Version + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Version.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableFeatures = []; + if (options.defaults) { + object.versionNumber = ""; + object.defaultVersion = false; + } + if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) + object.versionNumber = message.versionNumber; + if (message.defaultVersion != null && message.hasOwnProperty("defaultVersion")) + object.defaultVersion = message.defaultVersion; + if (message.availableFeatures && message.availableFeatures.length) { + object.availableFeatures = []; + for (var j = 0; j < message.availableFeatures.length; ++j) + object.availableFeatures[j] = message.availableFeatures[j]; + } + return object; + }; + + /** + * Converts this Version to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.Version + * @instance + * @returns {Object.} JSON object + */ + Version.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Version; + })(); + + v1beta1.Accelerator = (function() { + + /** + * Properties of an Accelerator. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IAccelerator + * @property {google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType|null} [acceleratorType] Accelerator acceleratorType + */ + + /** + * Constructs a new Accelerator. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an Accelerator. + * @implements IAccelerator + * @constructor + * @param {google.cloud.datafusion.v1beta1.IAccelerator=} [properties] Properties to set + */ + function Accelerator(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Accelerator acceleratorType. + * @member {google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType} acceleratorType + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @instance + */ + Accelerator.prototype.acceleratorType = 0; + + /** + * Creates a new Accelerator instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {google.cloud.datafusion.v1beta1.IAccelerator=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.Accelerator} Accelerator instance + */ + Accelerator.create = function create(properties) { + return new Accelerator(properties); + }; + + /** + * Encodes the specified Accelerator message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Accelerator.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {google.cloud.datafusion.v1beta1.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.acceleratorType); + return writer; + }; + + /** + * Encodes the specified Accelerator message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Accelerator.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {google.cloud.datafusion.v1beta1.IAccelerator} message Accelerator message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Accelerator.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decode = function 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.datafusion.v1beta1.Accelerator(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceleratorType = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Accelerator message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.Accelerator} Accelerator + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Accelerator.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Accelerator message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Accelerator.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + switch (message.acceleratorType) { + default: + return "acceleratorType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an Accelerator message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.Accelerator} Accelerator + */ + Accelerator.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.Accelerator) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.Accelerator(); + switch (object.acceleratorType) { + case "ACCELERATOR_TYPE_UNSPECIFIED": + case 0: + message.acceleratorType = 0; + break; + case "CDC": + case 1: + message.acceleratorType = 1; + break; + case "HEALTHCARE": + case 2: + message.acceleratorType = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an Accelerator message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {google.cloud.datafusion.v1beta1.Accelerator} message Accelerator + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Accelerator.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) + object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; + return object; + }; + + /** + * Converts this Accelerator to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @instance + * @returns {Object.} JSON object + */ + Accelerator.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AcceleratorType enum. + * @name google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType + * @enum {number} + * @property {number} ACCELERATOR_TYPE_UNSPECIFIED=0 ACCELERATOR_TYPE_UNSPECIFIED value + * @property {number} CDC=1 CDC value + * @property {number} HEALTHCARE=2 HEALTHCARE value + */ + Accelerator.AcceleratorType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCELERATOR_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CDC"] = 1; + values[valuesById[2] = "HEALTHCARE"] = 2; + return values; + })(); + + return Accelerator; + })(); + + v1beta1.CryptoKeyConfig = (function() { + + /** + * Properties of a CryptoKeyConfig. + * @memberof google.cloud.datafusion.v1beta1 + * @interface ICryptoKeyConfig + * @property {string|null} [keyReference] CryptoKeyConfig keyReference + */ + + /** + * Constructs a new CryptoKeyConfig. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a CryptoKeyConfig. + * @implements ICryptoKeyConfig + * @constructor + * @param {google.cloud.datafusion.v1beta1.ICryptoKeyConfig=} [properties] Properties to set + */ + function CryptoKeyConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CryptoKeyConfig keyReference. + * @member {string} keyReference + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @instance + */ + CryptoKeyConfig.prototype.keyReference = ""; + + /** + * Creates a new CryptoKeyConfig instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1beta1.ICryptoKeyConfig=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.CryptoKeyConfig} CryptoKeyConfig instance + */ + CryptoKeyConfig.create = function create(properties) { + return new CryptoKeyConfig(properties); + }; + + /** + * Encodes the specified CryptoKeyConfig message. Does not implicitly {@link google.cloud.datafusion.v1beta1.CryptoKeyConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1beta1.ICryptoKeyConfig} message CryptoKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keyReference != null && Object.hasOwnProperty.call(message, "keyReference")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.keyReference); + return writer; + }; + + /** + * Encodes the specified CryptoKeyConfig message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.CryptoKeyConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1beta1.ICryptoKeyConfig} message CryptoKeyConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CryptoKeyConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.CryptoKeyConfig} CryptoKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyConfig.decode = function 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.datafusion.v1beta1.CryptoKeyConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.keyReference = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CryptoKeyConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.CryptoKeyConfig} CryptoKeyConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CryptoKeyConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CryptoKeyConfig message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CryptoKeyConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keyReference != null && message.hasOwnProperty("keyReference")) + if (!$util.isString(message.keyReference)) + return "keyReference: string expected"; + return null; + }; + + /** + * Creates a CryptoKeyConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.CryptoKeyConfig} CryptoKeyConfig + */ + CryptoKeyConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig(); + if (object.keyReference != null) + message.keyReference = String(object.keyReference); + return message; + }; + + /** + * Creates a plain object from a CryptoKeyConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {google.cloud.datafusion.v1beta1.CryptoKeyConfig} message CryptoKeyConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CryptoKeyConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.keyReference = ""; + if (message.keyReference != null && message.hasOwnProperty("keyReference")) + object.keyReference = message.keyReference; + return object; + }; + + /** + * Converts this CryptoKeyConfig to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @instance + * @returns {Object.} JSON object + */ + CryptoKeyConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CryptoKeyConfig; + })(); + + v1beta1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {google.cloud.datafusion.v1beta1.Instance.Type|null} [type] Instance type + * @property {boolean|null} [enableStackdriverLogging] Instance enableStackdriverLogging + * @property {boolean|null} [enableStackdriverMonitoring] Instance enableStackdriverMonitoring + * @property {boolean|null} [privateInstance] Instance privateInstance + * @property {google.cloud.datafusion.v1beta1.INetworkConfig|null} [networkConfig] Instance networkConfig + * @property {Object.|null} [labels] Instance labels + * @property {Object.|null} [options] Instance options + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Instance updateTime + * @property {google.cloud.datafusion.v1beta1.Instance.State|null} [state] Instance state + * @property {string|null} [stateMessage] Instance stateMessage + * @property {string|null} [serviceEndpoint] Instance serviceEndpoint + * @property {string|null} [zone] Instance zone + * @property {string|null} [version] Instance version + * @property {string|null} [serviceAccount] Instance serviceAccount + * @property {string|null} [displayName] Instance displayName + * @property {Array.|null} [availableVersion] Instance availableVersion + * @property {string|null} [apiEndpoint] Instance apiEndpoint + * @property {string|null} [gcsBucket] Instance gcsBucket + * @property {Array.|null} [accelerators] Instance accelerators + * @property {string|null} [p4ServiceAccount] Instance p4ServiceAccount + * @property {string|null} [tenantProjectId] Instance tenantProjectId + * @property {string|null} [dataprocServiceAccount] Instance dataprocServiceAccount + * @property {boolean|null} [enableRbac] Instance enableRbac + * @property {google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null} [cryptoKeyConfig] Instance cryptoKeyConfig + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.datafusion.v1beta1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.options = {}; + this.availableVersion = []; + this.accelerators = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Instance name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance type. + * @member {google.cloud.datafusion.v1beta1.Instance.Type} type + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.type = 0; + + /** + * Instance enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.enableStackdriverLogging = false; + + /** + * Instance enableStackdriverMonitoring. + * @member {boolean} enableStackdriverMonitoring + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.enableStackdriverMonitoring = false; + + /** + * Instance privateInstance. + * @member {boolean} privateInstance + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.privateInstance = false; + + /** + * Instance networkConfig. + * @member {google.cloud.datafusion.v1beta1.INetworkConfig|null|undefined} networkConfig + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.networkConfig = null; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance options. + * @member {Object.} options + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.options = $util.emptyObject; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.updateTime = null; + + /** + * Instance state. + * @member {google.cloud.datafusion.v1beta1.Instance.State} state + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance stateMessage. + * @member {string} stateMessage + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.stateMessage = ""; + + /** + * Instance serviceEndpoint. + * @member {string} serviceEndpoint + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.serviceEndpoint = ""; + + /** + * Instance zone. + * @member {string} zone + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.zone = ""; + + /** + * Instance version. + * @member {string} version + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.version = ""; + + /** + * Instance serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.serviceAccount = ""; + + /** + * Instance displayName. + * @member {string} displayName + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.displayName = ""; + + /** + * Instance availableVersion. + * @member {Array.} availableVersion + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.availableVersion = $util.emptyArray; + + /** + * Instance apiEndpoint. + * @member {string} apiEndpoint + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.apiEndpoint = ""; + + /** + * Instance gcsBucket. + * @member {string} gcsBucket + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.gcsBucket = ""; + + /** + * Instance accelerators. + * @member {Array.} accelerators + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.accelerators = $util.emptyArray; + + /** + * Instance p4ServiceAccount. + * @member {string} p4ServiceAccount + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.p4ServiceAccount = ""; + + /** + * Instance tenantProjectId. + * @member {string} tenantProjectId + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.tenantProjectId = ""; + + /** + * Instance dataprocServiceAccount. + * @member {string} dataprocServiceAccount + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.dataprocServiceAccount = ""; + + /** + * Instance enableRbac. + * @member {boolean} enableRbac + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.enableRbac = false; + + /** + * Instance cryptoKeyConfig. + * @member {google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null|undefined} cryptoKeyConfig + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.cryptoKeyConfig = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {google.cloud.datafusion.v1beta1.IInstance=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {google.cloud.datafusion.v1beta1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableStackdriverLogging); + if (message.enableStackdriverMonitoring != null && Object.hasOwnProperty.call(message, "enableStackdriverMonitoring")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.enableStackdriverMonitoring); + if (message.privateInstance != null && Object.hasOwnProperty.call(message, "privateInstance")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.privateInstance); + if (message.networkConfig != null && Object.hasOwnProperty.call(message, "networkConfig")) + $root.google.cloud.datafusion.v1beta1.NetworkConfig.encode(message.networkConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + for (var keys = Object.keys(message.options), i = 0; i < keys.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.options[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.state); + if (message.stateMessage != null && Object.hasOwnProperty.call(message, "stateMessage")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.stateMessage); + if (message.serviceEndpoint != null && Object.hasOwnProperty.call(message, "serviceEndpoint")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.serviceEndpoint); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.zone); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.version); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.serviceAccount); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.displayName); + if (message.availableVersion != null && message.availableVersion.length) + for (var i = 0; i < message.availableVersion.length; ++i) + $root.google.cloud.datafusion.v1beta1.Version.encode(message.availableVersion[i], writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.apiEndpoint != null && Object.hasOwnProperty.call(message, "apiEndpoint")) + writer.uint32(/* id 20, wireType 2 =*/162).string(message.apiEndpoint); + if (message.gcsBucket != null && Object.hasOwnProperty.call(message, "gcsBucket")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.gcsBucket); + if (message.accelerators != null && message.accelerators.length) + for (var i = 0; i < message.accelerators.length; ++i) + $root.google.cloud.datafusion.v1beta1.Accelerator.encode(message.accelerators[i], writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.p4ServiceAccount != null && Object.hasOwnProperty.call(message, "p4ServiceAccount")) + writer.uint32(/* id 23, wireType 2 =*/186).string(message.p4ServiceAccount); + if (message.tenantProjectId != null && Object.hasOwnProperty.call(message, "tenantProjectId")) + writer.uint32(/* id 24, wireType 2 =*/194).string(message.tenantProjectId); + if (message.dataprocServiceAccount != null && Object.hasOwnProperty.call(message, "dataprocServiceAccount")) + writer.uint32(/* id 25, wireType 2 =*/202).string(message.dataprocServiceAccount); + if (message.enableRbac != null && Object.hasOwnProperty.call(message, "enableRbac")) + writer.uint32(/* id 26, wireType 0 =*/208).bool(message.enableRbac); + if (message.cryptoKeyConfig != null && Object.hasOwnProperty.call(message, "cryptoKeyConfig")) + $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.encode(message.cryptoKeyConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {google.cloud.datafusion.v1beta1.IInstance} message Instance message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Instance.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Instance message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decode = function 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.datafusion.v1beta1.Instance(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.type = reader.int32(); + break; + case 4: + message.enableStackdriverLogging = reader.bool(); + break; + case 5: + message.enableStackdriverMonitoring = reader.bool(); + break; + case 6: + message.privateInstance = reader.bool(); + break; + case 7: + message.networkConfig = $root.google.cloud.datafusion.v1beta1.NetworkConfig.decode(reader, reader.uint32()); + break; + case 8: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 9: + if (message.options === $util.emptyObject) + message.options = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.options[key] = value; + break; + case 10: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.state = reader.int32(); + break; + case 13: + message.stateMessage = reader.string(); + break; + case 14: + message.serviceEndpoint = reader.string(); + break; + case 15: + message.zone = reader.string(); + break; + case 16: + message.version = reader.string(); + break; + case 17: + message.serviceAccount = reader.string(); + break; + case 18: + message.displayName = reader.string(); + break; + case 19: + if (!(message.availableVersion && message.availableVersion.length)) + message.availableVersion = []; + message.availableVersion.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); + break; + case 20: + message.apiEndpoint = reader.string(); + break; + case 21: + message.gcsBucket = reader.string(); + break; + case 22: + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.datafusion.v1beta1.Accelerator.decode(reader, reader.uint32())); + break; + case 23: + message.p4ServiceAccount = reader.string(); + break; + case 24: + message.tenantProjectId = reader.string(); + break; + case 25: + message.dataprocServiceAccount = reader.string(); + break; + case 26: + message.enableRbac = reader.bool(); + break; + case 27: + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Instance message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.Instance} Instance + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Instance.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Instance message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Instance.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) + if (typeof message.enableStackdriverMonitoring !== "boolean") + return "enableStackdriverMonitoring: boolean expected"; + if (message.privateInstance != null && message.hasOwnProperty("privateInstance")) + if (typeof message.privateInstance !== "boolean") + return "privateInstance: boolean expected"; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) { + var error = $root.google.cloud.datafusion.v1beta1.NetworkConfig.verify(message.networkConfig); + if (error) + return "networkConfig." + error; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.options != null && message.hasOwnProperty("options")) { + if (!$util.isObject(message.options)) + return "options: object expected"; + var key = Object.keys(message.options); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.options[key[i]])) + return "options: string{k: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: + case 6: + case 7: + case 8: + case 9: + break; + } + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + if (!$util.isString(message.stateMessage)) + return "stateMessage: string expected"; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + if (!$util.isString(message.serviceEndpoint)) + return "serviceEndpoint: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.availableVersion != null && message.hasOwnProperty("availableVersion")) { + if (!Array.isArray(message.availableVersion)) + return "availableVersion: array expected"; + for (var i = 0; i < message.availableVersion.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.Version.verify(message.availableVersion[i]); + if (error) + return "availableVersion." + error; + } + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) + if (!$util.isString(message.apiEndpoint)) + return "apiEndpoint: string expected"; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + if (!$util.isString(message.gcsBucket)) + return "gcsBucket: string expected"; + if (message.accelerators != null && message.hasOwnProperty("accelerators")) { + if (!Array.isArray(message.accelerators)) + return "accelerators: array expected"; + for (var i = 0; i < message.accelerators.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.Accelerator.verify(message.accelerators[i]); + if (error) + return "accelerators." + error; + } + } + if (message.p4ServiceAccount != null && message.hasOwnProperty("p4ServiceAccount")) + if (!$util.isString(message.p4ServiceAccount)) + return "p4ServiceAccount: string expected"; + if (message.tenantProjectId != null && message.hasOwnProperty("tenantProjectId")) + if (!$util.isString(message.tenantProjectId)) + return "tenantProjectId: string expected"; + if (message.dataprocServiceAccount != null && message.hasOwnProperty("dataprocServiceAccount")) + if (!$util.isString(message.dataprocServiceAccount)) + return "dataprocServiceAccount: string expected"; + if (message.enableRbac != null && message.hasOwnProperty("enableRbac")) + if (typeof message.enableRbac !== "boolean") + return "enableRbac: boolean expected"; + if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) { + var error = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.verify(message.cryptoKeyConfig); + if (error) + return "cryptoKeyConfig." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.Instance) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BASIC": + case 1: + message.type = 1; + break; + case "ENTERPRISE": + case 2: + message.type = 2; + break; + case "DEVELOPER": + case 3: + message.type = 3; + break; + } + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + if (object.enableStackdriverMonitoring != null) + message.enableStackdriverMonitoring = Boolean(object.enableStackdriverMonitoring); + if (object.privateInstance != null) + message.privateInstance = Boolean(object.privateInstance); + if (object.networkConfig != null) { + if (typeof object.networkConfig !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.networkConfig: object expected"); + message.networkConfig = $root.google.cloud.datafusion.v1beta1.NetworkConfig.fromObject(object.networkConfig); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.labels: object expected"); + message.labels = {}; + for (var keys = Object.keys(object.labels), i = 0; i < keys.length; ++i) + message.labels[keys[i]] = String(object.labels[keys[i]]); + } + if (object.options) { + if (typeof object.options !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.options: object expected"); + message.options = {}; + for (var keys = Object.keys(object.options), i = 0; i < keys.length; ++i) + message.options[keys[i]] = String(object.options[keys[i]]); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.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.datafusion.v1beta1.Instance.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "FAILED": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "UPGRADING": + case 5: + message.state = 5; + break; + case "RESTARTING": + case 6: + message.state = 6; + break; + case "UPDATING": + case 7: + message.state = 7; + break; + case "AUTO_UPDATING": + case 8: + message.state = 8; + break; + case "AUTO_UPGRADING": + case 9: + message.state = 9; + break; + } + if (object.stateMessage != null) + message.stateMessage = String(object.stateMessage); + if (object.serviceEndpoint != null) + message.serviceEndpoint = String(object.serviceEndpoint); + if (object.zone != null) + message.zone = String(object.zone); + if (object.version != null) + message.version = String(object.version); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.availableVersion) { + if (!Array.isArray(object.availableVersion)) + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.availableVersion: array expected"); + message.availableVersion = []; + for (var i = 0; i < object.availableVersion.length; ++i) { + if (typeof object.availableVersion[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.availableVersion: object expected"); + message.availableVersion[i] = $root.google.cloud.datafusion.v1beta1.Version.fromObject(object.availableVersion[i]); + } + } + if (object.apiEndpoint != null) + message.apiEndpoint = String(object.apiEndpoint); + if (object.gcsBucket != null) + message.gcsBucket = String(object.gcsBucket); + if (object.accelerators) { + if (!Array.isArray(object.accelerators)) + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.accelerators: array expected"); + message.accelerators = []; + for (var i = 0; i < object.accelerators.length; ++i) { + if (typeof object.accelerators[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.accelerators: object expected"); + message.accelerators[i] = $root.google.cloud.datafusion.v1beta1.Accelerator.fromObject(object.accelerators[i]); + } + } + if (object.p4ServiceAccount != null) + message.p4ServiceAccount = String(object.p4ServiceAccount); + if (object.tenantProjectId != null) + message.tenantProjectId = String(object.tenantProjectId); + if (object.dataprocServiceAccount != null) + message.dataprocServiceAccount = String(object.dataprocServiceAccount); + if (object.enableRbac != null) + message.enableRbac = Boolean(object.enableRbac); + if (object.cryptoKeyConfig != null) { + if (typeof object.cryptoKeyConfig !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.cryptoKeyConfig: object expected"); + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.fromObject(object.cryptoKeyConfig); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {google.cloud.datafusion.v1beta1.Instance} message Instance + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Instance.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.availableVersion = []; + object.accelerators = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.options = {}; + } + if (options.defaults) { + object.name = ""; + object.description = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.enableStackdriverLogging = false; + object.enableStackdriverMonitoring = false; + object.privateInstance = false; + object.networkConfig = null; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.stateMessage = ""; + object.serviceEndpoint = ""; + object.zone = ""; + object.version = ""; + object.serviceAccount = ""; + object.displayName = ""; + object.apiEndpoint = ""; + object.gcsBucket = ""; + object.p4ServiceAccount = ""; + object.tenantProjectId = ""; + object.dataprocServiceAccount = ""; + object.enableRbac = false; + object.cryptoKeyConfig = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.Type[message.type] : message.type; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) + object.enableStackdriverMonitoring = message.enableStackdriverMonitoring; + if (message.privateInstance != null && message.hasOwnProperty("privateInstance")) + object.privateInstance = message.privateInstance; + if (message.networkConfig != null && message.hasOwnProperty("networkConfig")) + object.networkConfig = $root.google.cloud.datafusion.v1beta1.NetworkConfig.toObject(message.networkConfig, options); + var keys2; + if (message.labels && (keys2 = Object.keys(message.labels)).length) { + object.labels = {}; + for (var j = 0; j < keys2.length; ++j) + object.labels[keys2[j]] = message.labels[keys2[j]]; + } + if (message.options && (keys2 = Object.keys(message.options)).length) { + object.options = {}; + for (var j = 0; j < keys2.length; ++j) + object.options[keys2[j]] = message.options[keys2[j]]; + } + 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.datafusion.v1beta1.Instance.State[message.state] : message.state; + if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) + object.stateMessage = message.stateMessage; + if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) + object.serviceEndpoint = message.serviceEndpoint; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.availableVersion && message.availableVersion.length) { + object.availableVersion = []; + for (var j = 0; j < message.availableVersion.length; ++j) + object.availableVersion[j] = $root.google.cloud.datafusion.v1beta1.Version.toObject(message.availableVersion[j], options); + } + if (message.apiEndpoint != null && message.hasOwnProperty("apiEndpoint")) + object.apiEndpoint = message.apiEndpoint; + if (message.gcsBucket != null && message.hasOwnProperty("gcsBucket")) + object.gcsBucket = message.gcsBucket; + if (message.accelerators && message.accelerators.length) { + object.accelerators = []; + for (var j = 0; j < message.accelerators.length; ++j) + object.accelerators[j] = $root.google.cloud.datafusion.v1beta1.Accelerator.toObject(message.accelerators[j], options); + } + if (message.p4ServiceAccount != null && message.hasOwnProperty("p4ServiceAccount")) + object.p4ServiceAccount = message.p4ServiceAccount; + if (message.tenantProjectId != null && message.hasOwnProperty("tenantProjectId")) + object.tenantProjectId = message.tenantProjectId; + if (message.dataprocServiceAccount != null && message.hasOwnProperty("dataprocServiceAccount")) + object.dataprocServiceAccount = message.dataprocServiceAccount; + if (message.enableRbac != null && message.hasOwnProperty("enableRbac")) + object.enableRbac = message.enableRbac; + if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) + object.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.toObject(message.cryptoKeyConfig, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.datafusion.v1beta1.Instance.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} BASIC=1 BASIC value + * @property {number} ENTERPRISE=2 ENTERPRISE value + * @property {number} DEVELOPER=3 DEVELOPER value + */ + Instance.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BASIC"] = 1; + values[valuesById[2] = "ENTERPRISE"] = 2; + values[valuesById[3] = "DEVELOPER"] = 3; + return values; + })(); + + /** + * State enum. + * @name google.cloud.datafusion.v1beta1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} FAILED=3 FAILED value + * @property {number} DELETING=4 DELETING value + * @property {number} UPGRADING=5 UPGRADING value + * @property {number} RESTARTING=6 RESTARTING value + * @property {number} UPDATING=7 UPDATING value + * @property {number} AUTO_UPDATING=8 AUTO_UPDATING value + * @property {number} AUTO_UPGRADING=9 AUTO_UPGRADING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "UPGRADING"] = 5; + values[valuesById[6] = "RESTARTING"] = 6; + values[valuesById[7] = "UPDATING"] = 7; + values[valuesById[8] = "AUTO_UPDATING"] = 8; + values[valuesById[9] = "AUTO_UPGRADING"] = 9; + return values; + })(); + + return Instance; + })(); + + v1beta1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [filter] ListInstancesRequest filter + * @property {string|null} [orderBy] ListInstancesRequest orderBy + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest=} [properties] Properties to set + */ + function ListInstancesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListInstancesRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.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 ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesRequest} message ListInstancesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decode = function 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.datafusion.v1beta1.ListInstancesRequest(); + 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 ListInstancesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListInstancesRequest} ListInstancesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesRequest.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 ListInstancesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListInstancesRequest(); + 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 ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ListInstancesRequest} message ListInstancesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesRequest.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 ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @instance + * @returns {Object.} JSON object + */ + ListInstancesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesRequest; + })(); + + v1beta1.ListInstancesResponse = (function() { + + /** + * Properties of a ListInstancesResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListInstancesResponse + * @property {Array.|null} [instances] ListInstancesResponse instances + * @property {string|null} [nextPageToken] ListInstancesResponse nextPageToken + * @property {Array.|null} [unreachable] ListInstancesResponse unreachable + */ + + /** + * Constructs a new ListInstancesResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListInstancesResponse=} [properties] Properties to set + */ + function ListInstancesResponse(properties) { + this.instances = []; + 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]]; + } + + /** + * ListInstancesResponse instances. + * @member {Array.} instances + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instances != null && message.instances.length) + for (var i = 0; i < message.instances.length; ++i) + $root.google.cloud.datafusion.v1beta1.Instance.encode(message.instances[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 ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListInstancesResponse} message ListInstancesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListInstancesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListInstancesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decode = function 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.datafusion.v1beta1.ListInstancesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.datafusion.v1beta1.Instance.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 ListInstancesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListInstancesResponse} ListInstancesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListInstancesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListInstancesResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListInstancesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instances != null && message.hasOwnProperty("instances")) { + if (!Array.isArray(message.instances)) + return "instances: array expected"; + for (var i = 0; i < message.instances.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.Instance.verify(message.instances[i]); + if (error) + return "instances." + 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 ListInstancesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.datafusion.v1beta1.ListInstancesResponse.instances: array expected"); + message.instances = []; + for (var i = 0; i < object.instances.length; ++i) { + if (typeof object.instances[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.datafusion.v1beta1.Instance.fromObject(object.instances[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.datafusion.v1beta1.ListInstancesResponse.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 ListInstancesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.ListInstancesResponse} message ListInstancesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListInstancesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.instances = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.instances && message.instances.length) { + object.instances = []; + for (var j = 0; j < message.instances.length; ++j) + object.instances[j] = $root.google.cloud.datafusion.v1beta1.Instance.toObject(message.instances[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 ListInstancesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1beta1.ListAvailableVersionsRequest = (function() { + + /** + * Properties of a ListAvailableVersionsRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListAvailableVersionsRequest + * @property {string|null} [parent] ListAvailableVersionsRequest parent + * @property {number|null} [pageSize] ListAvailableVersionsRequest pageSize + * @property {string|null} [pageToken] ListAvailableVersionsRequest pageToken + * @property {boolean|null} [latestPatchOnly] ListAvailableVersionsRequest latestPatchOnly + */ + + /** + * Constructs a new ListAvailableVersionsRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListAvailableVersionsRequest. + * @implements IListAvailableVersionsRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest=} [properties] Properties to set + */ + function ListAvailableVersionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAvailableVersionsRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.parent = ""; + + /** + * ListAvailableVersionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.pageSize = 0; + + /** + * ListAvailableVersionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.pageToken = ""; + + /** + * ListAvailableVersionsRequest latestPatchOnly. + * @member {boolean} latestPatchOnly + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @instance + */ + ListAvailableVersionsRequest.prototype.latestPatchOnly = false; + + /** + * Creates a new ListAvailableVersionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest} ListAvailableVersionsRequest instance + */ + ListAvailableVersionsRequest.create = function create(properties) { + return new ListAvailableVersionsRequest(properties); + }; + + /** + * Encodes the specified ListAvailableVersionsRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest} message ListAvailableVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsRequest.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.latestPatchOnly != null && Object.hasOwnProperty.call(message, "latestPatchOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.latestPatchOnly); + return writer; + }; + + /** + * Encodes the specified ListAvailableVersionsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest} message ListAvailableVersionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsRequest.decode = function 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.datafusion.v1beta1.ListAvailableVersionsRequest(); + 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.latestPatchOnly = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAvailableVersionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAvailableVersionsRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAvailableVersionsRequest.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.latestPatchOnly != null && message.hasOwnProperty("latestPatchOnly")) + if (typeof message.latestPatchOnly !== "boolean") + return "latestPatchOnly: boolean expected"; + return null; + }; + + /** + * Creates a ListAvailableVersionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest} ListAvailableVersionsRequest + */ + ListAvailableVersionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest(); + 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.latestPatchOnly != null) + message.latestPatchOnly = Boolean(object.latestPatchOnly); + return message; + }; + + /** + * Creates a plain object from a ListAvailableVersionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest} message ListAvailableVersionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAvailableVersionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.latestPatchOnly = false; + } + 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.latestPatchOnly != null && message.hasOwnProperty("latestPatchOnly")) + object.latestPatchOnly = message.latestPatchOnly; + return object; + }; + + /** + * Converts this ListAvailableVersionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAvailableVersionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAvailableVersionsRequest; + })(); + + v1beta1.ListAvailableVersionsResponse = (function() { + + /** + * Properties of a ListAvailableVersionsResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListAvailableVersionsResponse + * @property {Array.|null} [availableVersions] ListAvailableVersionsResponse availableVersions + * @property {string|null} [nextPageToken] ListAvailableVersionsResponse nextPageToken + */ + + /** + * Constructs a new ListAvailableVersionsResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListAvailableVersionsResponse. + * @implements IListAvailableVersionsResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse=} [properties] Properties to set + */ + function ListAvailableVersionsResponse(properties) { + this.availableVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAvailableVersionsResponse availableVersions. + * @member {Array.} availableVersions + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @instance + */ + ListAvailableVersionsResponse.prototype.availableVersions = $util.emptyArray; + + /** + * ListAvailableVersionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @instance + */ + ListAvailableVersionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAvailableVersionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} ListAvailableVersionsResponse instance + */ + ListAvailableVersionsResponse.create = function create(properties) { + return new ListAvailableVersionsResponse(properties); + }; + + /** + * Encodes the specified ListAvailableVersionsResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse} message ListAvailableVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.availableVersions != null && message.availableVersions.length) + for (var i = 0; i < message.availableVersions.length; ++i) + $root.google.cloud.datafusion.v1beta1.Version.encode(message.availableVersions[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 ListAvailableVersionsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse} message ListAvailableVersionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAvailableVersionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsResponse.decode = function 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.datafusion.v1beta1.ListAvailableVersionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.availableVersions && message.availableVersions.length)) + message.availableVersions = []; + message.availableVersions.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAvailableVersionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAvailableVersionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAvailableVersionsResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAvailableVersionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.availableVersions != null && message.hasOwnProperty("availableVersions")) { + if (!Array.isArray(message.availableVersions)) + return "availableVersions: array expected"; + for (var i = 0; i < message.availableVersions.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.Version.verify(message.availableVersions[i]); + if (error) + return "availableVersions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAvailableVersionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} ListAvailableVersionsResponse + */ + ListAvailableVersionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse(); + if (object.availableVersions) { + if (!Array.isArray(object.availableVersions)) + throw TypeError(".google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.availableVersions: array expected"); + message.availableVersions = []; + for (var i = 0; i < object.availableVersions.length; ++i) { + if (typeof object.availableVersions[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse.availableVersions: object expected"); + message.availableVersions[i] = $root.google.cloud.datafusion.v1beta1.Version.fromObject(object.availableVersions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAvailableVersionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse} message ListAvailableVersionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAvailableVersionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.availableVersions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.availableVersions && message.availableVersions.length) { + object.availableVersions = []; + for (var j = 0; j < message.availableVersions.length; ++j) + object.availableVersions[j] = $root.google.cloud.datafusion.v1beta1.Version.toObject(message.availableVersions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAvailableVersionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAvailableVersionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAvailableVersionsResponse; + })(); + + v1beta1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest=} [properties] Properties to set + */ + function GetInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.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 GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IGetInstanceRequest} message GetInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decode = function 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.datafusion.v1beta1.GetInstanceRequest(); + 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 GetInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.GetInstanceRequest} GetInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetInstanceRequest.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 GetInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.GetInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.GetInstanceRequest} message GetInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetInstanceRequest.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 GetInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1beta1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.datafusion.v1beta1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest=} [properties] Properties to set + */ + function CreateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateInstanceRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.datafusion.v1beta1.IInstance|null|undefined} instance + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.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.instanceId != null && Object.hasOwnProperty.call(message, "instanceId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.instanceId); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.datafusion.v1beta1.Instance.encode(message.instance, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ICreateInstanceRequest} message CreateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decode = function 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.datafusion.v1beta1.CreateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.instanceId = reader.string(); + break; + case 3: + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.CreateInstanceRequest} CreateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateInstanceRequest.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.instanceId != null && message.hasOwnProperty("instanceId")) + if (!$util.isString(message.instanceId)) + return "instanceId: string expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.datafusion.v1beta1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates a CreateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.CreateInstanceRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.instanceId != null) + message.instanceId = String(object.instanceId); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from a CreateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.CreateInstanceRequest} message CreateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.instanceId = ""; + object.instance = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.instanceId != null && message.hasOwnProperty("instanceId")) + object.instanceId = message.instanceId; + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.datafusion.v1beta1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1beta1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set + */ + function DeleteInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decode = function 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.datafusion.v1beta1.DeleteInstanceRequest(); + 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 DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteInstanceRequest.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 DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteInstanceRequest.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 DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1beta1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IUpdateInstanceRequest + * @property {google.cloud.datafusion.v1beta1.IInstance|null} [instance] UpdateInstanceRequest instance + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest=} [properties] Properties to set + */ + function UpdateInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.datafusion.v1beta1.IInstance|null|undefined} instance + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * UpdateInstanceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.datafusion.v1beta1.Instance.encode(message.instance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpdateInstanceRequest} message UpdateInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decode = function 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.datafusion.v1beta1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateInstanceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.datafusion.v1beta1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.UpdateInstanceRequest(); + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.fromObject(object.instance); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.UpdateInstanceRequest} message UpdateInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.instance = null; + object.updateMask = null; + } + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.datafusion.v1beta1.Instance.toObject(message.instance, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1beta1.RestartInstanceRequest = (function() { + + /** + * Properties of a RestartInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IRestartInstanceRequest + * @property {string|null} [name] RestartInstanceRequest name + */ + + /** + * Constructs a new RestartInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a RestartInstanceRequest. + * @implements IRestartInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest=} [properties] Properties to set + */ + function RestartInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestartInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @instance + */ + RestartInstanceRequest.prototype.name = ""; + + /** + * Creates a new RestartInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.RestartInstanceRequest} RestartInstanceRequest instance + */ + RestartInstanceRequest.create = function create(properties) { + return new RestartInstanceRequest(properties); + }; + + /** + * Encodes the specified RestartInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RestartInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.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 RestartInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RestartInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRestartInstanceRequest} message RestartInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestartInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestartInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decode = function 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.datafusion.v1beta1.RestartInstanceRequest(); + 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 RestartInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.RestartInstanceRequest} RestartInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestartInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestartInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestartInstanceRequest.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 RestartInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.RestartInstanceRequest} RestartInstanceRequest + */ + RestartInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.RestartInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.RestartInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a RestartInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.RestartInstanceRequest} message RestartInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestartInstanceRequest.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 RestartInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestartInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestartInstanceRequest; + })(); + + v1beta1.UpgradeInstanceRequest = (function() { + + /** + * Properties of an UpgradeInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IUpgradeInstanceRequest + * @property {string|null} [name] UpgradeInstanceRequest name + */ + + /** + * Constructs a new UpgradeInstanceRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an UpgradeInstanceRequest. + * @implements IUpgradeInstanceRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest=} [properties] Properties to set + */ + function UpgradeInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpgradeInstanceRequest name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @instance + */ + UpgradeInstanceRequest.prototype.name = ""; + + /** + * Creates a new UpgradeInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.UpgradeInstanceRequest} UpgradeInstanceRequest instance + */ + UpgradeInstanceRequest.create = function create(properties) { + return new UpgradeInstanceRequest(properties); + }; + + /** + * Encodes the specified UpgradeInstanceRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpgradeInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest} message UpgradeInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeInstanceRequest.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 UpgradeInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.UpgradeInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest} message UpgradeInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpgradeInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpgradeInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.UpgradeInstanceRequest} UpgradeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeInstanceRequest.decode = function 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.datafusion.v1beta1.UpgradeInstanceRequest(); + 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 an UpgradeInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.UpgradeInstanceRequest} UpgradeInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpgradeInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpgradeInstanceRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpgradeInstanceRequest.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 an UpgradeInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.UpgradeInstanceRequest} UpgradeInstanceRequest + */ + UpgradeInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from an UpgradeInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {google.cloud.datafusion.v1beta1.UpgradeInstanceRequest} message UpgradeInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpgradeInstanceRequest.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 UpgradeInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpgradeInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpgradeInstanceRequest; + })(); + + v1beta1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.datafusion.v1beta1 + * @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} [statusDetail] OperationMetadata statusDetail + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @static + * @param {google.cloud.datafusion.v1beta1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.datafusion.v1beta1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @static + * @param {google.cloud.datafusion.v1beta1.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.statusDetail != null && Object.hasOwnProperty.call(message, "statusDetail")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusDetail); + 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.datafusion.v1beta1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.OperationMetadata + * @static + * @param {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.statusDetail = 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.datafusion.v1beta1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.statusDetail != null && message.hasOwnProperty("statusDetail")) + if (!$util.isString(message.statusDetail)) + return "statusDetail: 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.datafusion.v1beta1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.OperationMetadata) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.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.statusDetail != null) + message.statusDetail = String(object.statusDetail); + 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.datafusion.v1beta1.OperationMetadata + * @static + * @param {google.cloud.datafusion.v1beta1.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.statusDetail = ""; + 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.statusDetail != null && message.hasOwnProperty("statusDetail")) + object.statusDetail = message.statusDetail; + 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.datafusion.v1beta1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + v1beta1.RemoveIamPolicyRequest = (function() { + + /** + * Properties of a RemoveIamPolicyRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IRemoveIamPolicyRequest + * @property {string|null} [resource] RemoveIamPolicyRequest resource + */ + + /** + * Constructs a new RemoveIamPolicyRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a RemoveIamPolicyRequest. + * @implements IRemoveIamPolicyRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest=} [properties] Properties to set + */ + function RemoveIamPolicyRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveIamPolicyRequest resource. + * @member {string} resource + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @instance + */ + RemoveIamPolicyRequest.prototype.resource = ""; + + /** + * Creates a new RemoveIamPolicyRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest} RemoveIamPolicyRequest instance + */ + RemoveIamPolicyRequest.create = function create(properties) { + return new RemoveIamPolicyRequest(properties); + }; + + /** + * Encodes the specified RemoveIamPolicyRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest} message RemoveIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveIamPolicyRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.resource); + return writer; + }; + + /** + * Encodes the specified RemoveIamPolicyRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest} message RemoveIamPolicyRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveIamPolicyRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveIamPolicyRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest} RemoveIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveIamPolicyRequest.decode = function 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.datafusion.v1beta1.RemoveIamPolicyRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resource = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveIamPolicyRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest} RemoveIamPolicyRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveIamPolicyRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveIamPolicyRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveIamPolicyRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + return null; + }; + + /** + * Creates a RemoveIamPolicyRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest} RemoveIamPolicyRequest + */ + RemoveIamPolicyRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest(); + if (object.resource != null) + message.resource = String(object.resource); + return message; + }; + + /** + * Creates a plain object from a RemoveIamPolicyRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest} message RemoveIamPolicyRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveIamPolicyRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.resource = ""; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + return object; + }; + + /** + * Converts this RemoveIamPolicyRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveIamPolicyRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveIamPolicyRequest; + })(); + + v1beta1.RemoveIamPolicyResponse = (function() { + + /** + * Properties of a RemoveIamPolicyResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IRemoveIamPolicyResponse + */ + + /** + * Constructs a new RemoveIamPolicyResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a RemoveIamPolicyResponse. + * @implements IRemoveIamPolicyResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse=} [properties] Properties to set + */ + function RemoveIamPolicyResponse(properties) { + if (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 RemoveIamPolicyResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} RemoveIamPolicyResponse instance + */ + RemoveIamPolicyResponse.create = function create(properties) { + return new RemoveIamPolicyResponse(properties); + }; + + /** + * Encodes the specified RemoveIamPolicyResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse} message RemoveIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveIamPolicyResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemoveIamPolicyResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse} message RemoveIamPolicyResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveIamPolicyResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveIamPolicyResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} RemoveIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveIamPolicyResponse.decode = function 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.datafusion.v1beta1.RemoveIamPolicyResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveIamPolicyResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} RemoveIamPolicyResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveIamPolicyResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveIamPolicyResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveIamPolicyResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemoveIamPolicyResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} RemoveIamPolicyResponse + */ + RemoveIamPolicyResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse) + return object; + return new $root.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse(); + }; + + /** + * Creates a plain object from a RemoveIamPolicyResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse} message RemoveIamPolicyResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveIamPolicyResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveIamPolicyResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveIamPolicyResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveIamPolicyResponse; + })(); + + v1beta1.ListNamespacesRequest = (function() { + + /** + * Properties of a ListNamespacesRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListNamespacesRequest + * @property {string|null} [parent] ListNamespacesRequest parent + * @property {number|null} [pageSize] ListNamespacesRequest pageSize + * @property {string|null} [pageToken] ListNamespacesRequest pageToken + * @property {google.cloud.datafusion.v1beta1.NamespaceView|null} [view] ListNamespacesRequest view + */ + + /** + * Constructs a new ListNamespacesRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListNamespacesRequest. + * @implements IListNamespacesRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest=} [properties] Properties to set + */ + function ListNamespacesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNamespacesRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @instance + */ + ListNamespacesRequest.prototype.parent = ""; + + /** + * ListNamespacesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @instance + */ + ListNamespacesRequest.prototype.pageSize = 0; + + /** + * ListNamespacesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @instance + */ + ListNamespacesRequest.prototype.pageToken = ""; + + /** + * ListNamespacesRequest view. + * @member {google.cloud.datafusion.v1beta1.NamespaceView} view + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @instance + */ + ListNamespacesRequest.prototype.view = 0; + + /** + * Creates a new ListNamespacesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesRequest} ListNamespacesRequest instance + */ + ListNamespacesRequest.create = function create(properties) { + return new ListNamespacesRequest(properties); + }; + + /** + * Encodes the specified ListNamespacesRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest} message ListNamespacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNamespacesRequest.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.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListNamespacesRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesRequest} message ListNamespacesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNamespacesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNamespacesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesRequest} ListNamespacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNamespacesRequest.decode = function 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.datafusion.v1beta1.ListNamespacesRequest(); + 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.view = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNamespacesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesRequest} ListNamespacesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNamespacesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNamespacesRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNamespacesRequest.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.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListNamespacesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesRequest} ListNamespacesRequest + */ + ListNamespacesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListNamespacesRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListNamespacesRequest(); + 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); + switch (object.view) { + case "NAMESPACE_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "NAMESPACE_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "NAMESPACE_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListNamespacesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ListNamespacesRequest} message ListNamespacesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNamespacesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.view = options.enums === String ? "NAMESPACE_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.datafusion.v1beta1.NamespaceView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListNamespacesRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @instance + * @returns {Object.} JSON object + */ + ListNamespacesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNamespacesRequest; + })(); + + v1beta1.IAMPolicy = (function() { + + /** + * Properties of a IAMPolicy. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IIAMPolicy + * @property {google.iam.v1.IPolicy|null} [policy] IAMPolicy policy + * @property {google.rpc.IStatus|null} [status] IAMPolicy status + */ + + /** + * Constructs a new IAMPolicy. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a IAMPolicy. + * @implements IIAMPolicy + * @constructor + * @param {google.cloud.datafusion.v1beta1.IIAMPolicy=} [properties] Properties to set + */ + function IAMPolicy(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IAMPolicy policy. + * @member {google.iam.v1.IPolicy|null|undefined} policy + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @instance + */ + IAMPolicy.prototype.policy = null; + + /** + * IAMPolicy status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @instance + */ + IAMPolicy.prototype.status = null; + + /** + * Creates a new IAMPolicy instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {google.cloud.datafusion.v1beta1.IIAMPolicy=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.IAMPolicy} IAMPolicy instance + */ + IAMPolicy.create = function create(properties) { + return new IAMPolicy(properties); + }; + + /** + * Encodes the specified IAMPolicy message. Does not implicitly {@link google.cloud.datafusion.v1beta1.IAMPolicy.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {google.cloud.datafusion.v1beta1.IIAMPolicy} message IAMPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IAMPolicy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.policy != null && Object.hasOwnProperty.call(message, "policy")) + $root.google.iam.v1.Policy.encode(message.policy, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IAMPolicy message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.IAMPolicy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {google.cloud.datafusion.v1beta1.IIAMPolicy} message IAMPolicy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IAMPolicy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a IAMPolicy message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.IAMPolicy} IAMPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IAMPolicy.decode = function 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.datafusion.v1beta1.IAMPolicy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + case 2: + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a IAMPolicy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.IAMPolicy} IAMPolicy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IAMPolicy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a IAMPolicy message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IAMPolicy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.policy != null && message.hasOwnProperty("policy")) { + var error = $root.google.iam.v1.Policy.verify(message.policy); + if (error) + return "policy." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a IAMPolicy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.IAMPolicy} IAMPolicy + */ + IAMPolicy.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.IAMPolicy) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.IAMPolicy(); + if (object.policy != null) { + if (typeof object.policy !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.IAMPolicy.policy: object expected"); + message.policy = $root.google.iam.v1.Policy.fromObject(object.policy); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.IAMPolicy.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a IAMPolicy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {google.cloud.datafusion.v1beta1.IAMPolicy} message IAMPolicy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IAMPolicy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.policy = null; + object.status = null; + } + if (message.policy != null && message.hasOwnProperty("policy")) + object.policy = $root.google.iam.v1.Policy.toObject(message.policy, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this IAMPolicy to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @instance + * @returns {Object.} JSON object + */ + IAMPolicy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return IAMPolicy; + })(); + + v1beta1.Namespace = (function() { + + /** + * Properties of a Namespace. + * @memberof google.cloud.datafusion.v1beta1 + * @interface INamespace + * @property {string|null} [name] Namespace name + * @property {google.cloud.datafusion.v1beta1.IIAMPolicy|null} [iamPolicy] Namespace iamPolicy + */ + + /** + * Constructs a new Namespace. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a Namespace. + * @implements INamespace + * @constructor + * @param {google.cloud.datafusion.v1beta1.INamespace=} [properties] Properties to set + */ + function Namespace(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Namespace name. + * @member {string} name + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @instance + */ + Namespace.prototype.name = ""; + + /** + * Namespace iamPolicy. + * @member {google.cloud.datafusion.v1beta1.IIAMPolicy|null|undefined} iamPolicy + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @instance + */ + Namespace.prototype.iamPolicy = null; + + /** + * Creates a new Namespace instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {google.cloud.datafusion.v1beta1.INamespace=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.Namespace} Namespace instance + */ + Namespace.create = function create(properties) { + return new Namespace(properties); + }; + + /** + * Encodes the specified Namespace message. Does not implicitly {@link google.cloud.datafusion.v1beta1.Namespace.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {google.cloud.datafusion.v1beta1.INamespace} message Namespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Namespace.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.iamPolicy != null && Object.hasOwnProperty.call(message, "iamPolicy")) + $root.google.cloud.datafusion.v1beta1.IAMPolicy.encode(message.iamPolicy, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Namespace message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.Namespace.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {google.cloud.datafusion.v1beta1.INamespace} message Namespace message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Namespace.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Namespace message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.Namespace} Namespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Namespace.decode = function 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.datafusion.v1beta1.Namespace(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.iamPolicy = $root.google.cloud.datafusion.v1beta1.IAMPolicy.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Namespace message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.Namespace} Namespace + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Namespace.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Namespace message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Namespace.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.iamPolicy != null && message.hasOwnProperty("iamPolicy")) { + var error = $root.google.cloud.datafusion.v1beta1.IAMPolicy.verify(message.iamPolicy); + if (error) + return "iamPolicy." + error; + } + return null; + }; + + /** + * Creates a Namespace message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.Namespace} Namespace + */ + Namespace.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.Namespace) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.Namespace(); + if (object.name != null) + message.name = String(object.name); + if (object.iamPolicy != null) { + if (typeof object.iamPolicy !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.Namespace.iamPolicy: object expected"); + message.iamPolicy = $root.google.cloud.datafusion.v1beta1.IAMPolicy.fromObject(object.iamPolicy); + } + return message; + }; + + /** + * Creates a plain object from a Namespace message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {google.cloud.datafusion.v1beta1.Namespace} message Namespace + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Namespace.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.iamPolicy = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.iamPolicy != null && message.hasOwnProperty("iamPolicy")) + object.iamPolicy = $root.google.cloud.datafusion.v1beta1.IAMPolicy.toObject(message.iamPolicy, options); + return object; + }; + + /** + * Converts this Namespace to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @instance + * @returns {Object.} JSON object + */ + Namespace.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Namespace; + })(); + + v1beta1.ListNamespacesResponse = (function() { + + /** + * Properties of a ListNamespacesResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListNamespacesResponse + * @property {Array.|null} [namespaces] ListNamespacesResponse namespaces + * @property {string|null} [nextPageToken] ListNamespacesResponse nextPageToken + */ + + /** + * Constructs a new ListNamespacesResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListNamespacesResponse. + * @implements IListNamespacesResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListNamespacesResponse=} [properties] Properties to set + */ + function ListNamespacesResponse(properties) { + this.namespaces = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListNamespacesResponse namespaces. + * @member {Array.} namespaces + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @instance + */ + ListNamespacesResponse.prototype.namespaces = $util.emptyArray; + + /** + * ListNamespacesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @instance + */ + ListNamespacesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListNamespacesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesResponse} ListNamespacesResponse instance + */ + ListNamespacesResponse.create = function create(properties) { + return new ListNamespacesResponse(properties); + }; + + /** + * Encodes the specified ListNamespacesResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesResponse} message ListNamespacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNamespacesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.namespaces != null && message.namespaces.length) + for (var i = 0; i < message.namespaces.length; ++i) + $root.google.cloud.datafusion.v1beta1.Namespace.encode(message.namespaces[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 ListNamespacesResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListNamespacesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListNamespacesResponse} message ListNamespacesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListNamespacesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListNamespacesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesResponse} ListNamespacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNamespacesResponse.decode = function 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.datafusion.v1beta1.ListNamespacesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.namespaces && message.namespaces.length)) + message.namespaces = []; + message.namespaces.push($root.google.cloud.datafusion.v1beta1.Namespace.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListNamespacesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesResponse} ListNamespacesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListNamespacesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListNamespacesResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListNamespacesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.namespaces != null && message.hasOwnProperty("namespaces")) { + if (!Array.isArray(message.namespaces)) + return "namespaces: array expected"; + for (var i = 0; i < message.namespaces.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.Namespace.verify(message.namespaces[i]); + if (error) + return "namespaces." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListNamespacesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListNamespacesResponse} ListNamespacesResponse + */ + ListNamespacesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListNamespacesResponse) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListNamespacesResponse(); + if (object.namespaces) { + if (!Array.isArray(object.namespaces)) + throw TypeError(".google.cloud.datafusion.v1beta1.ListNamespacesResponse.namespaces: array expected"); + message.namespaces = []; + for (var i = 0; i < object.namespaces.length; ++i) { + if (typeof object.namespaces[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.ListNamespacesResponse.namespaces: object expected"); + message.namespaces[i] = $root.google.cloud.datafusion.v1beta1.Namespace.fromObject(object.namespaces[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListNamespacesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {google.cloud.datafusion.v1beta1.ListNamespacesResponse} message ListNamespacesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListNamespacesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.namespaces = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.namespaces && message.namespaces.length) { + object.namespaces = []; + for (var j = 0; j < message.namespaces.length; ++j) + object.namespaces[j] = $root.google.cloud.datafusion.v1beta1.Namespace.toObject(message.namespaces[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListNamespacesResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @instance + * @returns {Object.} JSON object + */ + ListNamespacesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListNamespacesResponse; + })(); + + v1beta1.DnsPeering = (function() { + + /** + * Properties of a DnsPeering. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IDnsPeering + * @property {string|null} [zone] DnsPeering zone + * @property {string|null} [domain] DnsPeering domain + * @property {string|null} [description] DnsPeering description + * @property {string|null} [targetProject] DnsPeering targetProject + * @property {string|null} [targetNetwork] DnsPeering targetNetwork + */ + + /** + * Constructs a new DnsPeering. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a DnsPeering. + * @implements IDnsPeering + * @constructor + * @param {google.cloud.datafusion.v1beta1.IDnsPeering=} [properties] Properties to set + */ + function DnsPeering(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DnsPeering zone. + * @member {string} zone + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + */ + DnsPeering.prototype.zone = ""; + + /** + * DnsPeering domain. + * @member {string} domain + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + */ + DnsPeering.prototype.domain = ""; + + /** + * DnsPeering description. + * @member {string} description + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + */ + DnsPeering.prototype.description = ""; + + /** + * DnsPeering targetProject. + * @member {string} targetProject + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + */ + DnsPeering.prototype.targetProject = ""; + + /** + * DnsPeering targetNetwork. + * @member {string} targetNetwork + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + */ + DnsPeering.prototype.targetNetwork = ""; + + /** + * Creates a new DnsPeering instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {google.cloud.datafusion.v1beta1.IDnsPeering=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.DnsPeering} DnsPeering instance + */ + DnsPeering.create = function create(properties) { + return new DnsPeering(properties); + }; + + /** + * Encodes the specified DnsPeering message. Does not implicitly {@link google.cloud.datafusion.v1beta1.DnsPeering.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {google.cloud.datafusion.v1beta1.IDnsPeering} message DnsPeering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsPeering.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.zone); + if (message.domain != null && Object.hasOwnProperty.call(message, "domain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.domain); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.targetProject != null && Object.hasOwnProperty.call(message, "targetProject")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetProject); + if (message.targetNetwork != null && Object.hasOwnProperty.call(message, "targetNetwork")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.targetNetwork); + return writer; + }; + + /** + * Encodes the specified DnsPeering message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.DnsPeering.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {google.cloud.datafusion.v1beta1.IDnsPeering} message DnsPeering message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DnsPeering.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DnsPeering message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.DnsPeering} DnsPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsPeering.decode = function 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.datafusion.v1beta1.DnsPeering(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.zone = reader.string(); + break; + case 2: + message.domain = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.targetProject = reader.string(); + break; + case 5: + message.targetNetwork = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DnsPeering message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.DnsPeering} DnsPeering + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DnsPeering.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DnsPeering message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DnsPeering.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + if (message.domain != null && message.hasOwnProperty("domain")) + if (!$util.isString(message.domain)) + return "domain: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + if (!$util.isString(message.targetProject)) + return "targetProject: string expected"; + if (message.targetNetwork != null && message.hasOwnProperty("targetNetwork")) + if (!$util.isString(message.targetNetwork)) + return "targetNetwork: string expected"; + return null; + }; + + /** + * Creates a DnsPeering message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.DnsPeering} DnsPeering + */ + DnsPeering.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.DnsPeering) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.DnsPeering(); + if (object.zone != null) + message.zone = String(object.zone); + if (object.domain != null) + message.domain = String(object.domain); + if (object.description != null) + message.description = String(object.description); + if (object.targetProject != null) + message.targetProject = String(object.targetProject); + if (object.targetNetwork != null) + message.targetNetwork = String(object.targetNetwork); + return message; + }; + + /** + * Creates a plain object from a DnsPeering message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {google.cloud.datafusion.v1beta1.DnsPeering} message DnsPeering + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DnsPeering.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.zone = ""; + object.domain = ""; + object.description = ""; + object.targetProject = ""; + object.targetNetwork = ""; + } + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + if (message.domain != null && message.hasOwnProperty("domain")) + object.domain = message.domain; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.targetProject != null && message.hasOwnProperty("targetProject")) + object.targetProject = message.targetProject; + if (message.targetNetwork != null && message.hasOwnProperty("targetNetwork")) + object.targetNetwork = message.targetNetwork; + return object; + }; + + /** + * Converts this DnsPeering to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @instance + * @returns {Object.} JSON object + */ + DnsPeering.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DnsPeering; + })(); + + v1beta1.AddDnsPeeringRequest = (function() { + + /** + * Properties of an AddDnsPeeringRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IAddDnsPeeringRequest + * @property {string|null} [parent] AddDnsPeeringRequest parent + * @property {google.cloud.datafusion.v1beta1.IDnsPeering|null} [dnsPeering] AddDnsPeeringRequest dnsPeering + */ + + /** + * Constructs a new AddDnsPeeringRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an AddDnsPeeringRequest. + * @implements IAddDnsPeeringRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest=} [properties] Properties to set + */ + function AddDnsPeeringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AddDnsPeeringRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @instance + */ + AddDnsPeeringRequest.prototype.parent = ""; + + /** + * AddDnsPeeringRequest dnsPeering. + * @member {google.cloud.datafusion.v1beta1.IDnsPeering|null|undefined} dnsPeering + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @instance + */ + AddDnsPeeringRequest.prototype.dnsPeering = null; + + /** + * Creates a new AddDnsPeeringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringRequest} AddDnsPeeringRequest instance + */ + AddDnsPeeringRequest.create = function create(properties) { + return new AddDnsPeeringRequest(properties); + }; + + /** + * Encodes the specified AddDnsPeeringRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest} message AddDnsPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddDnsPeeringRequest.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.dnsPeering != null && Object.hasOwnProperty.call(message, "dnsPeering")) + $root.google.cloud.datafusion.v1beta1.DnsPeering.encode(message.dnsPeering, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AddDnsPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest} message AddDnsPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddDnsPeeringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddDnsPeeringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringRequest} AddDnsPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddDnsPeeringRequest.decode = function 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.datafusion.v1beta1.AddDnsPeeringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.dnsPeering = $root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddDnsPeeringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringRequest} AddDnsPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddDnsPeeringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddDnsPeeringRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddDnsPeeringRequest.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.dnsPeering != null && message.hasOwnProperty("dnsPeering")) { + var error = $root.google.cloud.datafusion.v1beta1.DnsPeering.verify(message.dnsPeering); + if (error) + return "dnsPeering." + error; + } + return null; + }; + + /** + * Creates an AddDnsPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringRequest} AddDnsPeeringRequest + */ + AddDnsPeeringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.dnsPeering != null) { + if (typeof object.dnsPeering !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.AddDnsPeeringRequest.dnsPeering: object expected"); + message.dnsPeering = $root.google.cloud.datafusion.v1beta1.DnsPeering.fromObject(object.dnsPeering); + } + return message; + }; + + /** + * Creates a plain object from an AddDnsPeeringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.AddDnsPeeringRequest} message AddDnsPeeringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddDnsPeeringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.dnsPeering = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.dnsPeering != null && message.hasOwnProperty("dnsPeering")) + object.dnsPeering = $root.google.cloud.datafusion.v1beta1.DnsPeering.toObject(message.dnsPeering, options); + return object; + }; + + /** + * Converts this AddDnsPeeringRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @instance + * @returns {Object.} JSON object + */ + AddDnsPeeringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddDnsPeeringRequest; + })(); + + v1beta1.AddDnsPeeringResponse = (function() { + + /** + * Properties of an AddDnsPeeringResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IAddDnsPeeringResponse + */ + + /** + * Constructs a new AddDnsPeeringResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents an AddDnsPeeringResponse. + * @implements IAddDnsPeeringResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse=} [properties] Properties to set + */ + function AddDnsPeeringResponse(properties) { + if (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 AddDnsPeeringResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} AddDnsPeeringResponse instance + */ + AddDnsPeeringResponse.create = function create(properties) { + return new AddDnsPeeringResponse(properties); + }; + + /** + * Encodes the specified AddDnsPeeringResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse} message AddDnsPeeringResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddDnsPeeringResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified AddDnsPeeringResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse} message AddDnsPeeringResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AddDnsPeeringResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AddDnsPeeringResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} AddDnsPeeringResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddDnsPeeringResponse.decode = function 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.datafusion.v1beta1.AddDnsPeeringResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AddDnsPeeringResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} AddDnsPeeringResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AddDnsPeeringResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AddDnsPeeringResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AddDnsPeeringResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an AddDnsPeeringResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} AddDnsPeeringResponse + */ + AddDnsPeeringResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse) + return object; + return new $root.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse(); + }; + + /** + * Creates a plain object from an AddDnsPeeringResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.AddDnsPeeringResponse} message AddDnsPeeringResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AddDnsPeeringResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this AddDnsPeeringResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @instance + * @returns {Object.} JSON object + */ + AddDnsPeeringResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AddDnsPeeringResponse; + })(); + + /** + * NamespaceView enum. + * @name google.cloud.datafusion.v1beta1.NamespaceView + * @enum {number} + * @property {number} NAMESPACE_VIEW_UNSPECIFIED=0 NAMESPACE_VIEW_UNSPECIFIED value + * @property {number} NAMESPACE_VIEW_BASIC=1 NAMESPACE_VIEW_BASIC value + * @property {number} NAMESPACE_VIEW_FULL=2 NAMESPACE_VIEW_FULL value + */ + v1beta1.NamespaceView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NAMESPACE_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "NAMESPACE_VIEW_BASIC"] = 1; + values[valuesById[2] = "NAMESPACE_VIEW_FULL"] = 2; + return values; + })(); + + v1beta1.RemoveDnsPeeringRequest = (function() { + + /** + * Properties of a RemoveDnsPeeringRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IRemoveDnsPeeringRequest + * @property {string|null} [parent] RemoveDnsPeeringRequest parent + * @property {string|null} [zone] RemoveDnsPeeringRequest zone + */ + + /** + * Constructs a new RemoveDnsPeeringRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a RemoveDnsPeeringRequest. + * @implements IRemoveDnsPeeringRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest=} [properties] Properties to set + */ + function RemoveDnsPeeringRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RemoveDnsPeeringRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @instance + */ + RemoveDnsPeeringRequest.prototype.parent = ""; + + /** + * RemoveDnsPeeringRequest zone. + * @member {string} zone + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @instance + */ + RemoveDnsPeeringRequest.prototype.zone = ""; + + /** + * Creates a new RemoveDnsPeeringRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest} RemoveDnsPeeringRequest instance + */ + RemoveDnsPeeringRequest.create = function create(properties) { + return new RemoveDnsPeeringRequest(properties); + }; + + /** + * Encodes the specified RemoveDnsPeeringRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest} message RemoveDnsPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveDnsPeeringRequest.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.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + return writer; + }; + + /** + * Encodes the specified RemoveDnsPeeringRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest} message RemoveDnsPeeringRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveDnsPeeringRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveDnsPeeringRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest} RemoveDnsPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveDnsPeeringRequest.decode = function 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.datafusion.v1beta1.RemoveDnsPeeringRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.zone = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveDnsPeeringRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest} RemoveDnsPeeringRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveDnsPeeringRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveDnsPeeringRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveDnsPeeringRequest.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.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a RemoveDnsPeeringRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest} RemoveDnsPeeringRequest + */ + RemoveDnsPeeringRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a RemoveDnsPeeringRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest} message RemoveDnsPeeringRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveDnsPeeringRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.zone = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this RemoveDnsPeeringRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @instance + * @returns {Object.} JSON object + */ + RemoveDnsPeeringRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveDnsPeeringRequest; + })(); + + v1beta1.RemoveDnsPeeringResponse = (function() { + + /** + * Properties of a RemoveDnsPeeringResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IRemoveDnsPeeringResponse + */ + + /** + * Constructs a new RemoveDnsPeeringResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a RemoveDnsPeeringResponse. + * @implements IRemoveDnsPeeringResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse=} [properties] Properties to set + */ + function RemoveDnsPeeringResponse(properties) { + if (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 RemoveDnsPeeringResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} RemoveDnsPeeringResponse instance + */ + RemoveDnsPeeringResponse.create = function create(properties) { + return new RemoveDnsPeeringResponse(properties); + }; + + /** + * Encodes the specified RemoveDnsPeeringResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse} message RemoveDnsPeeringResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveDnsPeeringResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RemoveDnsPeeringResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse} message RemoveDnsPeeringResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RemoveDnsPeeringResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RemoveDnsPeeringResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} RemoveDnsPeeringResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveDnsPeeringResponse.decode = function 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.datafusion.v1beta1.RemoveDnsPeeringResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RemoveDnsPeeringResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} RemoveDnsPeeringResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RemoveDnsPeeringResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RemoveDnsPeeringResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RemoveDnsPeeringResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RemoveDnsPeeringResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} RemoveDnsPeeringResponse + */ + RemoveDnsPeeringResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse) + return object; + return new $root.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse(); + }; + + /** + * Creates a plain object from a RemoveDnsPeeringResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse} message RemoveDnsPeeringResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RemoveDnsPeeringResponse.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RemoveDnsPeeringResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @instance + * @returns {Object.} JSON object + */ + RemoveDnsPeeringResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RemoveDnsPeeringResponse; + })(); + + v1beta1.ListDnsPeeringsRequest = (function() { + + /** + * Properties of a ListDnsPeeringsRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListDnsPeeringsRequest + * @property {string|null} [parent] ListDnsPeeringsRequest parent + * @property {number|null} [pageSize] ListDnsPeeringsRequest pageSize + * @property {string|null} [pageToken] ListDnsPeeringsRequest pageToken + */ + + /** + * Constructs a new ListDnsPeeringsRequest. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListDnsPeeringsRequest. + * @implements IListDnsPeeringsRequest + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest=} [properties] Properties to set + */ + function ListDnsPeeringsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDnsPeeringsRequest parent. + * @member {string} parent + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @instance + */ + ListDnsPeeringsRequest.prototype.parent = ""; + + /** + * ListDnsPeeringsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @instance + */ + ListDnsPeeringsRequest.prototype.pageSize = 0; + + /** + * ListDnsPeeringsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @instance + */ + ListDnsPeeringsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDnsPeeringsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest} ListDnsPeeringsRequest instance + */ + ListDnsPeeringsRequest.create = function create(properties) { + return new ListDnsPeeringsRequest(properties); + }; + + /** + * Encodes the specified ListDnsPeeringsRequest message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest} message ListDnsPeeringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsPeeringsRequest.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 ListDnsPeeringsRequest message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest} message ListDnsPeeringsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsPeeringsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsPeeringsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest} ListDnsPeeringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsPeeringsRequest.decode = function 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.datafusion.v1beta1.ListDnsPeeringsRequest(); + 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 ListDnsPeeringsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest} ListDnsPeeringsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsPeeringsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsPeeringsRequest message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsPeeringsRequest.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 ListDnsPeeringsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest} ListDnsPeeringsRequest + */ + ListDnsPeeringsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest(); + 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 ListDnsPeeringsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest} message ListDnsPeeringsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsPeeringsRequest.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 ListDnsPeeringsRequest to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDnsPeeringsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDnsPeeringsRequest; + })(); + + v1beta1.ListDnsPeeringsResponse = (function() { + + /** + * Properties of a ListDnsPeeringsResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @interface IListDnsPeeringsResponse + * @property {Array.|null} [dnsPeerings] ListDnsPeeringsResponse dnsPeerings + * @property {string|null} [nextPageToken] ListDnsPeeringsResponse nextPageToken + */ + + /** + * Constructs a new ListDnsPeeringsResponse. + * @memberof google.cloud.datafusion.v1beta1 + * @classdesc Represents a ListDnsPeeringsResponse. + * @implements IListDnsPeeringsResponse + * @constructor + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse=} [properties] Properties to set + */ + function ListDnsPeeringsResponse(properties) { + this.dnsPeerings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDnsPeeringsResponse dnsPeerings. + * @member {Array.} dnsPeerings + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @instance + */ + ListDnsPeeringsResponse.prototype.dnsPeerings = $util.emptyArray; + + /** + * ListDnsPeeringsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @instance + */ + ListDnsPeeringsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDnsPeeringsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse=} [properties] Properties to set + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} ListDnsPeeringsResponse instance + */ + ListDnsPeeringsResponse.create = function create(properties) { + return new ListDnsPeeringsResponse(properties); + }; + + /** + * Encodes the specified ListDnsPeeringsResponse message. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse} message ListDnsPeeringsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsPeeringsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dnsPeerings != null && message.dnsPeerings.length) + for (var i = 0; i < message.dnsPeerings.length; ++i) + $root.google.cloud.datafusion.v1beta1.DnsPeering.encode(message.dnsPeerings[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 ListDnsPeeringsResponse message, length delimited. Does not implicitly {@link google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse} message ListDnsPeeringsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDnsPeeringsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDnsPeeringsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} ListDnsPeeringsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsPeeringsResponse.decode = function 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.datafusion.v1beta1.ListDnsPeeringsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dnsPeerings && message.dnsPeerings.length)) + message.dnsPeerings = []; + message.dnsPeerings.push($root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDnsPeeringsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} ListDnsPeeringsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDnsPeeringsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDnsPeeringsResponse message. + * @function verify + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDnsPeeringsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dnsPeerings != null && message.hasOwnProperty("dnsPeerings")) { + if (!Array.isArray(message.dnsPeerings)) + return "dnsPeerings: array expected"; + for (var i = 0; i < message.dnsPeerings.length; ++i) { + var error = $root.google.cloud.datafusion.v1beta1.DnsPeering.verify(message.dnsPeerings[i]); + if (error) + return "dnsPeerings." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDnsPeeringsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} ListDnsPeeringsResponse + */ + ListDnsPeeringsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse) + return object; + var message = new $root.google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse(); + if (object.dnsPeerings) { + if (!Array.isArray(object.dnsPeerings)) + throw TypeError(".google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.dnsPeerings: array expected"); + message.dnsPeerings = []; + for (var i = 0; i < object.dnsPeerings.length; ++i) { + if (typeof object.dnsPeerings[i] !== "object") + throw TypeError(".google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse.dnsPeerings: object expected"); + message.dnsPeerings[i] = $root.google.cloud.datafusion.v1beta1.DnsPeering.fromObject(object.dnsPeerings[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDnsPeeringsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse} message ListDnsPeeringsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDnsPeeringsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dnsPeerings = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dnsPeerings && message.dnsPeerings.length) { + object.dnsPeerings = []; + for (var j = 0; j < message.dnsPeerings.length; ++j) + object.dnsPeerings[j] = $root.google.cloud.datafusion.v1beta1.DnsPeering.toObject(message.dnsPeerings[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDnsPeeringsResponse to JSON. + * @function toJSON + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDnsPeeringsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDnsPeeringsResponse; + })(); + + return v1beta1; + })(); + + return datafusion; + })(); + + 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); + }; + + 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); + }; + + 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); + }; + + 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 + */ + 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; + 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) { + 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: + 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] : 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]] : 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); + }; + + /** + * 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); + }; + + 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); + }; + + 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 + */ + + /** + * 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 = ""; + + /** + * 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); + 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; + 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"; + 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); + 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 = ""; + } + 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; + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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) { + 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) { + 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] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $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); + }; + + /** + * 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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) { + 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] : 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); + }; + + /** + * 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); + }; + + 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} [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 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.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 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.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: + 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) { + 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) { + 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.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: + 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; + } + } + 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[".google.api.resourceReference"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $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] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + 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]] : 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); + }; + + /** + * 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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) { + 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] : 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); + }; + + /** + * 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) + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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 + */ + + /** + * 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; + + /** + * 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); + 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; + 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"; + 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; + 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; + } + 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; + 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); + }; + + 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) + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + 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); + }; + + return Status; + })(); + + return rpc; + })(); + + google.iam = (function() { + + /** + * Namespace iam. + * @memberof google + * @namespace + */ + var iam = {}; + + iam.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.iam + * @namespace + */ + var v1 = {}; + + v1.Policy = (function() { + + /** + * Properties of a Policy. + * @memberof google.iam.v1 + * @interface IPolicy + * @property {number|null} [version] Policy version + * @property {Array.|null} [bindings] Policy bindings + * @property {Uint8Array|null} [etag] Policy etag + */ + + /** + * Constructs a new Policy. + * @memberof google.iam.v1 + * @classdesc Represents a Policy. + * @implements IPolicy + * @constructor + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + */ + function Policy(properties) { + this.bindings = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Policy version. + * @member {number} version + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.version = 0; + + /** + * Policy bindings. + * @member {Array.} bindings + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.bindings = $util.emptyArray; + + /** + * Policy etag. + * @member {Uint8Array} etag + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.etag = $util.newBuffer([]); + + /** + * Creates a new Policy instance using the specified properties. + * @function create + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy=} [properties] Properties to set + * @returns {google.iam.v1.Policy} Policy instance + */ + Policy.create = function create(properties) { + return new Policy(properties); + }; + + /** + * Encodes the specified Policy message. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.version); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.etag); + if (message.bindings != null && message.bindings.length) + for (var i = 0; i < message.bindings.length; ++i) + $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Policy message, length delimited. Does not implicitly {@link google.iam.v1.Policy.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.IPolicy} message Policy message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Policy.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Policy message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Policy(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.int32(); + break; + case 4: + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + case 3: + message.etag = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Policy message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Policy + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Policy} Policy + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Policy.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Policy message. + * @function verify + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Policy.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isInteger(message.version)) + return "version: integer expected"; + if (message.bindings != null && message.hasOwnProperty("bindings")) { + if (!Array.isArray(message.bindings)) + return "bindings: array expected"; + for (var i = 0; i < message.bindings.length; ++i) { + var error = $root.google.iam.v1.Binding.verify(message.bindings[i]); + if (error) + return "bindings." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) + return "etag: buffer expected"; + return null; + }; + + /** + * Creates a Policy message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Policy + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Policy} Policy + */ + Policy.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Policy) + return object; + var message = new $root.google.iam.v1.Policy(); + if (object.version != null) + message.version = object.version | 0; + if (object.bindings) { + if (!Array.isArray(object.bindings)) + throw TypeError(".google.iam.v1.Policy.bindings: array expected"); + message.bindings = []; + for (var i = 0; i < object.bindings.length; ++i) { + if (typeof object.bindings[i] !== "object") + throw TypeError(".google.iam.v1.Policy.bindings: object expected"); + message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); + } + } + if (object.etag != null) + if (typeof object.etag === "string") + $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); + else if (object.etag.length) + message.etag = object.etag; + return message; + }; + + /** + * Creates a plain object from a Policy message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Policy + * @static + * @param {google.iam.v1.Policy} message Policy + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Policy.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.bindings = []; + if (options.defaults) { + object.version = 0; + if (options.bytes === String) + object.etag = ""; + else { + object.etag = []; + if (options.bytes !== Array) + object.etag = $util.newBuffer(object.etag); + } + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = options.bytes === String ? $util.base64.encode(message.etag, 0, message.etag.length) : options.bytes === Array ? Array.prototype.slice.call(message.etag) : message.etag; + if (message.bindings && message.bindings.length) { + object.bindings = []; + for (var j = 0; j < message.bindings.length; ++j) + object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); + } + return object; + }; + + /** + * Converts this Policy to JSON. + * @function toJSON + * @memberof google.iam.v1.Policy + * @instance + * @returns {Object.} JSON object + */ + Policy.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Policy; + })(); + + v1.Binding = (function() { + + /** + * Properties of a Binding. + * @memberof google.iam.v1 + * @interface IBinding + * @property {string|null} [role] Binding role + * @property {Array.|null} [members] Binding members + * @property {google.type.IExpr|null} [condition] Binding condition + */ + + /** + * Constructs a new Binding. + * @memberof google.iam.v1 + * @classdesc Represents a Binding. + * @implements IBinding + * @constructor + * @param {google.iam.v1.IBinding=} [properties] Properties to set + */ + function Binding(properties) { + this.members = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Binding role. + * @member {string} role + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.role = ""; + + /** + * Binding members. + * @member {Array.} members + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.members = $util.emptyArray; + + /** + * Binding condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.Binding + * @instance + */ + Binding.prototype.condition = null; + + /** + * Creates a new Binding instance using the specified properties. + * @function create + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding=} [properties] Properties to set + * @returns {google.iam.v1.Binding} Binding instance + */ + Binding.create = function create(properties) { + return new Binding(properties); + }; + + /** + * Encodes the specified Binding message. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.role); + if (message.members != null && message.members.length) + for (var i = 0; i < message.members.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.members[i]); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Binding message, length delimited. Does not implicitly {@link google.iam.v1.Binding.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.IBinding} message Binding message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Binding.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Binding message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.Binding(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.role = reader.string(); + break; + case 2: + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + case 3: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Binding message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.Binding + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.Binding} Binding + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Binding.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Binding message. + * @function verify + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Binding.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.members != null && message.hasOwnProperty("members")) { + if (!Array.isArray(message.members)) + return "members: array expected"; + for (var i = 0; i < message.members.length; ++i) + if (!$util.isString(message.members[i])) + return "members: string[] expected"; + } + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a Binding message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.Binding + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.Binding} Binding + */ + Binding.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.Binding) + return object; + var message = new $root.google.iam.v1.Binding(); + if (object.role != null) + message.role = String(object.role); + if (object.members) { + if (!Array.isArray(object.members)) + throw TypeError(".google.iam.v1.Binding.members: array expected"); + message.members = []; + for (var i = 0; i < object.members.length; ++i) + message.members[i] = String(object.members[i]); + } + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.Binding.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a Binding message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.Binding + * @static + * @param {google.iam.v1.Binding} message Binding + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Binding.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.members = []; + if (options.defaults) { + object.role = ""; + object.condition = null; + } + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.members && message.members.length) { + object.members = []; + for (var j = 0; j < message.members.length; ++j) + object.members[j] = message.members[j]; + } + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this Binding to JSON. + * @function toJSON + * @memberof google.iam.v1.Binding + * @instance + * @returns {Object.} JSON object + */ + Binding.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Binding; + })(); + + v1.PolicyDelta = (function() { + + /** + * Properties of a PolicyDelta. + * @memberof google.iam.v1 + * @interface IPolicyDelta + * @property {Array.|null} [bindingDeltas] PolicyDelta bindingDeltas + * @property {Array.|null} [auditConfigDeltas] PolicyDelta auditConfigDeltas + */ + + /** + * Constructs a new PolicyDelta. + * @memberof google.iam.v1 + * @classdesc Represents a PolicyDelta. + * @implements IPolicyDelta + * @constructor + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + */ + function PolicyDelta(properties) { + this.bindingDeltas = []; + this.auditConfigDeltas = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PolicyDelta bindingDeltas. + * @member {Array.} bindingDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.bindingDeltas = $util.emptyArray; + + /** + * PolicyDelta auditConfigDeltas. + * @member {Array.} auditConfigDeltas + * @memberof google.iam.v1.PolicyDelta + * @instance + */ + PolicyDelta.prototype.auditConfigDeltas = $util.emptyArray; + + /** + * Creates a new PolicyDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta=} [properties] Properties to set + * @returns {google.iam.v1.PolicyDelta} PolicyDelta instance + */ + PolicyDelta.create = function create(properties) { + return new PolicyDelta(properties); + }; + + /** + * Encodes the specified PolicyDelta message. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.bindingDeltas != null && message.bindingDeltas.length) + for (var i = 0; i < message.bindingDeltas.length; ++i) + $root.google.iam.v1.BindingDelta.encode(message.bindingDeltas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.auditConfigDeltas != null && message.auditConfigDeltas.length) + for (var i = 0; i < message.auditConfigDeltas.length; ++i) + $root.google.iam.v1.AuditConfigDelta.encode(message.auditConfigDeltas[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PolicyDelta message, length delimited. Does not implicitly {@link google.iam.v1.PolicyDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.IPolicyDelta} message PolicyDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PolicyDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.PolicyDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PolicyDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PolicyDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PolicyDelta message. + * @function verify + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PolicyDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.bindingDeltas != null && message.hasOwnProperty("bindingDeltas")) { + if (!Array.isArray(message.bindingDeltas)) + return "bindingDeltas: array expected"; + for (var i = 0; i < message.bindingDeltas.length; ++i) { + var error = $root.google.iam.v1.BindingDelta.verify(message.bindingDeltas[i]); + if (error) + return "bindingDeltas." + error; + } + } + if (message.auditConfigDeltas != null && message.hasOwnProperty("auditConfigDeltas")) { + if (!Array.isArray(message.auditConfigDeltas)) + return "auditConfigDeltas: array expected"; + for (var i = 0; i < message.auditConfigDeltas.length; ++i) { + var error = $root.google.iam.v1.AuditConfigDelta.verify(message.auditConfigDeltas[i]); + if (error) + return "auditConfigDeltas." + error; + } + } + return null; + }; + + /** + * Creates a PolicyDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.PolicyDelta} PolicyDelta + */ + PolicyDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.PolicyDelta) + return object; + var message = new $root.google.iam.v1.PolicyDelta(); + if (object.bindingDeltas) { + if (!Array.isArray(object.bindingDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: array expected"); + message.bindingDeltas = []; + for (var i = 0; i < object.bindingDeltas.length; ++i) { + if (typeof object.bindingDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.bindingDeltas: object expected"); + message.bindingDeltas[i] = $root.google.iam.v1.BindingDelta.fromObject(object.bindingDeltas[i]); + } + } + if (object.auditConfigDeltas) { + if (!Array.isArray(object.auditConfigDeltas)) + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: array expected"); + message.auditConfigDeltas = []; + for (var i = 0; i < object.auditConfigDeltas.length; ++i) { + if (typeof object.auditConfigDeltas[i] !== "object") + throw TypeError(".google.iam.v1.PolicyDelta.auditConfigDeltas: object expected"); + message.auditConfigDeltas[i] = $root.google.iam.v1.AuditConfigDelta.fromObject(object.auditConfigDeltas[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PolicyDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {google.iam.v1.PolicyDelta} message PolicyDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PolicyDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.bindingDeltas = []; + object.auditConfigDeltas = []; + } + if (message.bindingDeltas && message.bindingDeltas.length) { + object.bindingDeltas = []; + for (var j = 0; j < message.bindingDeltas.length; ++j) + object.bindingDeltas[j] = $root.google.iam.v1.BindingDelta.toObject(message.bindingDeltas[j], options); + } + if (message.auditConfigDeltas && message.auditConfigDeltas.length) { + object.auditConfigDeltas = []; + for (var j = 0; j < message.auditConfigDeltas.length; ++j) + object.auditConfigDeltas[j] = $root.google.iam.v1.AuditConfigDelta.toObject(message.auditConfigDeltas[j], options); + } + return object; + }; + + /** + * Converts this PolicyDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.PolicyDelta + * @instance + * @returns {Object.} JSON object + */ + PolicyDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PolicyDelta; + })(); + + v1.BindingDelta = (function() { + + /** + * Properties of a BindingDelta. + * @memberof google.iam.v1 + * @interface IBindingDelta + * @property {google.iam.v1.BindingDelta.Action|null} [action] BindingDelta action + * @property {string|null} [role] BindingDelta role + * @property {string|null} [member] BindingDelta member + * @property {google.type.IExpr|null} [condition] BindingDelta condition + */ + + /** + * Constructs a new BindingDelta. + * @memberof google.iam.v1 + * @classdesc Represents a BindingDelta. + * @implements IBindingDelta + * @constructor + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + */ + function BindingDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BindingDelta action. + * @member {google.iam.v1.BindingDelta.Action} action + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.action = 0; + + /** + * BindingDelta role. + * @member {string} role + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.role = ""; + + /** + * BindingDelta member. + * @member {string} member + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.member = ""; + + /** + * BindingDelta condition. + * @member {google.type.IExpr|null|undefined} condition + * @memberof google.iam.v1.BindingDelta + * @instance + */ + BindingDelta.prototype.condition = null; + + /** + * Creates a new BindingDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta=} [properties] Properties to set + * @returns {google.iam.v1.BindingDelta} BindingDelta instance + */ + BindingDelta.create = function create(properties) { + return new BindingDelta(properties); + }; + + /** + * Encodes the specified BindingDelta message. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.role); + if (message.member != null && Object.hasOwnProperty.call(message, "member")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.member); + if (message.condition != null && Object.hasOwnProperty.call(message, "condition")) + $root.google.type.Expr.encode(message.condition, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BindingDelta message, length delimited. Does not implicitly {@link google.iam.v1.BindingDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.IBindingDelta} message BindingDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BindingDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.BindingDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.role = reader.string(); + break; + case 3: + message.member = reader.string(); + break; + case 4: + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BindingDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.BindingDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.BindingDelta} BindingDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BindingDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BindingDelta message. + * @function verify + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BindingDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.role != null && message.hasOwnProperty("role")) + if (!$util.isString(message.role)) + return "role: string expected"; + if (message.member != null && message.hasOwnProperty("member")) + if (!$util.isString(message.member)) + return "member: string expected"; + if (message.condition != null && message.hasOwnProperty("condition")) { + var error = $root.google.type.Expr.verify(message.condition); + if (error) + return "condition." + error; + } + return null; + }; + + /** + * Creates a BindingDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.BindingDelta} BindingDelta + */ + BindingDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.BindingDelta) + return object; + var message = new $root.google.iam.v1.BindingDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.role != null) + message.role = String(object.role); + if (object.member != null) + message.member = String(object.member); + if (object.condition != null) { + if (typeof object.condition !== "object") + throw TypeError(".google.iam.v1.BindingDelta.condition: object expected"); + message.condition = $root.google.type.Expr.fromObject(object.condition); + } + return message; + }; + + /** + * Creates a plain object from a BindingDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.BindingDelta + * @static + * @param {google.iam.v1.BindingDelta} message BindingDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BindingDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.role = ""; + object.member = ""; + object.condition = null; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + if (message.role != null && message.hasOwnProperty("role")) + object.role = message.role; + if (message.member != null && message.hasOwnProperty("member")) + object.member = message.member; + if (message.condition != null && message.hasOwnProperty("condition")) + object.condition = $root.google.type.Expr.toObject(message.condition, options); + return object; + }; + + /** + * Converts this BindingDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.BindingDelta + * @instance + * @returns {Object.} JSON object + */ + BindingDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.BindingDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + BindingDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return BindingDelta; + })(); + + v1.AuditConfigDelta = (function() { + + /** + * Properties of an AuditConfigDelta. + * @memberof google.iam.v1 + * @interface IAuditConfigDelta + * @property {google.iam.v1.AuditConfigDelta.Action|null} [action] AuditConfigDelta action + * @property {string|null} [service] AuditConfigDelta service + * @property {string|null} [exemptedMember] AuditConfigDelta exemptedMember + * @property {string|null} [logType] AuditConfigDelta logType + */ + + /** + * Constructs a new AuditConfigDelta. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfigDelta. + * @implements IAuditConfigDelta + * @constructor + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + */ + function AuditConfigDelta(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfigDelta action. + * @member {google.iam.v1.AuditConfigDelta.Action} action + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.action = 0; + + /** + * AuditConfigDelta service. + * @member {string} service + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.service = ""; + + /** + * AuditConfigDelta exemptedMember. + * @member {string} exemptedMember + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.exemptedMember = ""; + + /** + * AuditConfigDelta logType. + * @member {string} logType + * @memberof google.iam.v1.AuditConfigDelta + * @instance + */ + AuditConfigDelta.prototype.logType = ""; + + /** + * Creates a new AuditConfigDelta instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta instance + */ + AuditConfigDelta.create = function create(properties) { + return new AuditConfigDelta(properties); + }; + + /** + * Encodes the specified AuditConfigDelta message. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.action); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.service); + if (message.exemptedMember != null && Object.hasOwnProperty.call(message, "exemptedMember")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.exemptedMember); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.logType); + return writer; + }; + + /** + * Encodes the specified AuditConfigDelta message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfigDelta.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.IAuditConfigDelta} message AuditConfigDelta message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfigDelta.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfigDelta(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.action = reader.int32(); + break; + case 2: + message.service = reader.string(); + break; + case 3: + message.exemptedMember = reader.string(); + break; + case 4: + message.logType = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfigDelta message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfigDelta.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfigDelta message. + * @function verify + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfigDelta.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.action != null && message.hasOwnProperty("action")) + switch (message.action) { + default: + return "action: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + if (!$util.isString(message.exemptedMember)) + return "exemptedMember: string expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + if (!$util.isString(message.logType)) + return "logType: string expected"; + return null; + }; + + /** + * Creates an AuditConfigDelta message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfigDelta} AuditConfigDelta + */ + AuditConfigDelta.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfigDelta) + return object; + var message = new $root.google.iam.v1.AuditConfigDelta(); + switch (object.action) { + case "ACTION_UNSPECIFIED": + case 0: + message.action = 0; + break; + case "ADD": + case 1: + message.action = 1; + break; + case "REMOVE": + case 2: + message.action = 2; + break; + } + if (object.service != null) + message.service = String(object.service); + if (object.exemptedMember != null) + message.exemptedMember = String(object.exemptedMember); + if (object.logType != null) + message.logType = String(object.logType); + return message; + }; + + /** + * Creates a plain object from an AuditConfigDelta message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {google.iam.v1.AuditConfigDelta} message AuditConfigDelta + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfigDelta.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.action = options.enums === String ? "ACTION_UNSPECIFIED" : 0; + object.service = ""; + object.exemptedMember = ""; + object.logType = ""; + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) + object.exemptedMember = message.exemptedMember; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = message.logType; + return object; + }; + + /** + * Converts this AuditConfigDelta to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfigDelta + * @instance + * @returns {Object.} JSON object + */ + AuditConfigDelta.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Action enum. + * @name google.iam.v1.AuditConfigDelta.Action + * @enum {number} + * @property {number} ACTION_UNSPECIFIED=0 ACTION_UNSPECIFIED value + * @property {number} ADD=1 ADD value + * @property {number} REMOVE=2 REMOVE value + */ + AuditConfigDelta.Action = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADD"] = 1; + values[valuesById[2] = "REMOVE"] = 2; + return values; + })(); + + return AuditConfigDelta; + })(); + + return v1; + })(); + + return iam; + })(); + + google.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + type.Expr = (function() { + + /** + * Properties of an Expr. + * @memberof google.type + * @interface IExpr + * @property {string|null} [expression] Expr expression + * @property {string|null} [title] Expr title + * @property {string|null} [description] Expr description + * @property {string|null} [location] Expr location + */ + + /** + * Constructs a new Expr. + * @memberof google.type + * @classdesc Represents an Expr. + * @implements IExpr + * @constructor + * @param {google.type.IExpr=} [properties] Properties to set + */ + function Expr(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Expr expression. + * @member {string} expression + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.expression = ""; + + /** + * Expr title. + * @member {string} title + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.title = ""; + + /** + * Expr description. + * @member {string} description + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.description = ""; + + /** + * Expr location. + * @member {string} location + * @memberof google.type.Expr + * @instance + */ + Expr.prototype.location = ""; + + /** + * Creates a new Expr instance using the specified properties. + * @function create + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr=} [properties] Properties to set + * @returns {google.type.Expr} Expr instance + */ + Expr.create = function create(properties) { + return new Expr(properties); + }; + + /** + * Encodes the specified Expr message. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encode + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.expression != null && Object.hasOwnProperty.call(message, "expression")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.expression); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.location); + return writer; + }; + + /** + * Encodes the specified Expr message, length delimited. Does not implicitly {@link google.type.Expr.verify|verify} messages. + * @function encodeDelimited + * @memberof google.type.Expr + * @static + * @param {google.type.IExpr} message Expr message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Expr.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Expr message from the specified reader or buffer. + * @function decode + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.type.Expr(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.expression = reader.string(); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.location = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Expr message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.type.Expr + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.type.Expr} Expr + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Expr.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Expr message. + * @function verify + * @memberof google.type.Expr + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Expr.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.expression != null && message.hasOwnProperty("expression")) + if (!$util.isString(message.expression)) + return "expression: string expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + return null; + }; + + /** + * Creates an Expr message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.type.Expr + * @static + * @param {Object.} object Plain object + * @returns {google.type.Expr} Expr + */ + Expr.fromObject = function fromObject(object) { + if (object instanceof $root.google.type.Expr) + return object; + var message = new $root.google.type.Expr(); + if (object.expression != null) + message.expression = String(object.expression); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.location != null) + message.location = String(object.location); + return message; + }; + + /** + * Creates a plain object from an Expr message. Also converts values to other types if specified. + * @function toObject + * @memberof google.type.Expr + * @static + * @param {google.type.Expr} message Expr + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Expr.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.expression = ""; + object.title = ""; + object.description = ""; + object.location = ""; + } + if (message.expression != null && message.hasOwnProperty("expression")) + object.expression = message.expression; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + return object; + }; + + /** + * Converts this Expr to JSON. + * @function toJSON + * @memberof google.type.Expr + * @instance + * @returns {Object.} JSON object + */ + Expr.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Expr; + })(); + + return type; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-datafusion/protos/protos.json b/packages/google-cloud-datafusion/protos/protos.json new file mode 100644 index 00000000000..292fcccecbf --- /dev/null +++ b/packages/google-cloud-datafusion/protos/protos.json @@ -0,0 +1,3037 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "datafusion": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.DataFusion.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/datafusion/v1;datafusion", + "java_multiple_files": true, + "java_package": "com.google.cloud.datafusion.v1", + "php_namespace": "Google\\Cloud\\DataFusion\\V1", + "ruby_package": "Google::Cloud::DataFusion::V1" + }, + "nested": { + "DataFusion": { + "options": { + "(google.api.default_host)": "datafusion.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAvailableVersions": { + "requestType": "ListAvailableVersionsRequest", + "responseType": "ListAvailableVersionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/instances" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/instances" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/instances/*}", + "(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/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{instance.name=projects/*/locations/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartInstance": { + "requestType": "RestartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:restart", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:restart", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "ipAllocation": { + "type": "string", + "id": 2 + } + } + }, + "Version": { + "fields": { + "versionNumber": { + "type": "string", + "id": 1 + }, + "defaultVersion": { + "type": "bool", + "id": 2 + }, + "availableFeatures": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "acceleratorType": { + "type": "AcceleratorType", + "id": 1 + }, + "state": { + "type": "State", + "id": 2 + } + }, + "nested": { + "AcceleratorType": { + "values": { + "ACCELERATOR_TYPE_UNSPECIFIED": 0, + "CDC": 1, + "HEALTHCARE": 2, + "CCAI_INSIGHTS": 3 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ENABLED": 1, + "DISABLED": 2, + "UNKNOWN": 3 + } + } + } + }, + "CryptoKeyConfig": { + "fields": { + "keyReference": { + "type": "string", + "id": 1 + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "datafusion.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "enableStackdriverLogging": { + "type": "bool", + "id": 4 + }, + "enableStackdriverMonitoring": { + "type": "bool", + "id": 5 + }, + "privateInstance": { + "type": "bool", + "id": 6 + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "options": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceEndpoint": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 15 + }, + "version": { + "type": "string", + "id": 16 + }, + "serviceAccount": { + "type": "string", + "id": 17, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 18 + }, + "availableVersion": { + "rule": "repeated", + "type": "Version", + "id": 19 + }, + "apiEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcsBucket": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 22 + }, + "p4ServiceAccount": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tenantProjectId": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataprocServiceAccount": { + "type": "string", + "id": 25 + }, + "enableRbac": { + "type": "bool", + "id": 27 + }, + "cryptoKeyConfig": { + "type": "CryptoKeyConfig", + "id": 28 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "BASIC": 1, + "ENTERPRISE": 2, + "DEVELOPER": 3 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "FAILED": 3, + "DELETING": 4, + "UPGRADING": 5, + "RESTARTING": 6, + "UPDATING": 7, + "AUTO_UPDATING": 8, + "AUTO_UPGRADING": 9 + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListAvailableVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "latestPatchOnly": { + "type": "bool", + "id": 4 + } + } + }, + "ListAvailableVersionsResponse": { + "fields": { + "availableVersions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "instance": { + "type": "Instance", + "id": 3 + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "RestartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusDetail": { + "type": "string", + "id": 5 + }, + "requestedCancellation": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + }, + "additionalStatus": { + "keyType": "string", + "type": "string", + "id": 8 + } + } + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.DataFusion.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/datafusion/v1beta1;datafusion", + "java_multiple_files": true, + "java_package": "com.google.cloud.datafusion.v1beta1", + "php_namespace": "Google\\Cloud\\DataFusion\\V1beta1", + "ruby_package": "Google::Cloud::DataFusion::V1beta1" + }, + "nested": { + "DataFusion": { + "options": { + "(google.api.default_host)": "datafusion.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListAvailableVersions": { + "requestType": "ListAvailableVersionsRequest", + "responseType": "ListAvailableVersionsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/versions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/versions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/instances" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/instances" + } + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/instances/*}" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/instances/*}" + } + } + ] + }, + "CreateInstance": { + "requestType": "CreateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/instances", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "parent,instance,instance_id", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/instances", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "parent,instance,instance_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteInstance": { + "requestType": "DeleteInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/instances/*}", + "(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": "/v1beta1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateInstance": { + "requestType": "UpdateInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{instance.name=projects/*/locations/*/instances/*}", + "(google.api.http).body": "instance", + "(google.api.method_signature)": "instance,update_mask", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{instance.name=projects/*/locations/*/instances/*}", + "body": "instance" + } + }, + { + "(google.api.method_signature)": "instance,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestartInstance": { + "requestType": "RestartInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/instances/*}:restart", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/instances/*}:restart", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpgradeInstance": { + "requestType": "UpgradeInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RemoveIamPolicy": { + "requestType": "RemoveIamPolicyRequest", + "responseType": "RemoveIamPolicyResponse", + "options": { + "(google.api.http).post": "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy", + "body": "*" + } + } + ] + }, + "ListNamespaces": { + "requestType": "ListNamespacesRequest", + "responseType": "ListNamespacesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/namespaces", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/namespaces" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "AddDnsPeering": { + "requestType": "AddDnsPeeringRequest", + "responseType": "AddDnsPeeringResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:add", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:add", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "RemoveDnsPeering": { + "requestType": "RemoveDnsPeeringRequest", + "responseType": "RemoveDnsPeeringResponse", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListDnsPeerings": { + "requestType": "ListDnsPeeringsRequest", + "responseType": "ListDnsPeeringsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "ipAllocation": { + "type": "string", + "id": 2 + } + } + }, + "Version": { + "fields": { + "versionNumber": { + "type": "string", + "id": 1 + }, + "defaultVersion": { + "type": "bool", + "id": 2 + }, + "availableFeatures": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "Accelerator": { + "fields": { + "acceleratorType": { + "type": "AcceleratorType", + "id": 1 + } + }, + "nested": { + "AcceleratorType": { + "values": { + "ACCELERATOR_TYPE_UNSPECIFIED": 0, + "CDC": 1, + "HEALTHCARE": 2 + } + } + } + }, + "CryptoKeyConfig": { + "fields": { + "keyReference": { + "type": "string", + "id": 1 + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "datafusion.googleapis.com/Instance", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "enableStackdriverLogging": { + "type": "bool", + "id": 4 + }, + "enableStackdriverMonitoring": { + "type": "bool", + "id": 5 + }, + "privateInstance": { + "type": "bool", + "id": 6 + }, + "networkConfig": { + "type": "NetworkConfig", + "id": 7 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + }, + "options": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "stateMessage": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceEndpoint": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "zone": { + "type": "string", + "id": 15 + }, + "version": { + "type": "string", + "id": 16 + }, + "serviceAccount": { + "type": "string", + "id": 17, + "options": { + "deprecated": true, + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "displayName": { + "type": "string", + "id": 18 + }, + "availableVersion": { + "rule": "repeated", + "type": "Version", + "id": 19 + }, + "apiEndpoint": { + "type": "string", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcsBucket": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "accelerators": { + "rule": "repeated", + "type": "Accelerator", + "id": 22 + }, + "p4ServiceAccount": { + "type": "string", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tenantProjectId": { + "type": "string", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataprocServiceAccount": { + "type": "string", + "id": 25 + }, + "enableRbac": { + "type": "bool", + "id": 26 + }, + "cryptoKeyConfig": { + "type": "CryptoKeyConfig", + "id": 27 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "BASIC": 1, + "ENTERPRISE": 2, + "DEVELOPER": 3 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "RUNNING": 2, + "FAILED": 3, + "DELETING": 4, + "UPGRADING": 5, + "RESTARTING": 6, + "UPDATING": 7, + "AUTO_UPDATING": 8, + "AUTO_UPGRADING": 9 + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 + }, + "orderBy": { + "type": "string", + "id": 5 + } + } + }, + "ListInstancesResponse": { + "fields": { + "instances": { + "rule": "repeated", + "type": "Instance", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "ListAvailableVersionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "latestPatchOnly": { + "type": "bool", + "id": 4 + } + } + }, + "ListAvailableVersionsResponse": { + "fields": { + "availableVersions": { + "rule": "repeated", + "type": "Version", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "instanceId": { + "type": "string", + "id": 2 + }, + "instance": { + "type": "Instance", + "id": 3 + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "instance": { + "type": "Instance", + "id": 1 + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "RestartInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "UpgradeInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "target": { + "type": "string", + "id": 3 + }, + "verb": { + "type": "string", + "id": 4 + }, + "statusDetail": { + "type": "string", + "id": 5 + }, + "requestedCancellation": { + "type": "bool", + "id": 6 + }, + "apiVersion": { + "type": "string", + "id": 7 + } + } + }, + "RemoveIamPolicyRequest": { + "fields": { + "resource": { + "type": "string", + "id": 1 + } + } + }, + "RemoveIamPolicyResponse": { + "fields": {} + }, + "ListNamespacesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "view": { + "type": "NamespaceView", + "id": 4 + } + } + }, + "IAMPolicy": { + "fields": { + "policy": { + "type": "google.iam.v1.Policy", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "Namespace": { + "options": { + "(google.api.resource).type": "datafusion.googleapis.com/Namespace", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "iamPolicy": { + "type": "IAMPolicy", + "id": 2 + } + } + }, + "ListNamespacesResponse": { + "fields": { + "namespaces": { + "rule": "repeated", + "type": "Namespace", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DnsPeering": { + "fields": { + "zone": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "domain": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetProject": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "targetNetwork": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AddDnsPeeringRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "dnsPeering": { + "type": "DnsPeering", + "id": 2 + } + } + }, + "AddDnsPeeringResponse": { + "fields": {} + }, + "NamespaceView": { + "values": { + "NAMESPACE_VIEW_UNSPECIFIED": 0, + "NAMESPACE_VIEW_BASIC": 1, + "NAMESPACE_VIEW_FULL": 2 + } + }, + "RemoveDnsPeeringRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1 + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RemoveDnsPeeringResponse": { + "fields": {} + }, + "ListDnsPeeringsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDnsPeeringsResponse": { + "fields": { + "dnsPeerings": { + "rule": "repeated", + "type": "DnsPeering", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions" + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6 + } + }, + "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 + } + } + }, + "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": [ + [ + 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 + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + }, + "iam": { + "nested": { + "v1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Iam.V1", + "go_package": "google.golang.org/genproto/googleapis/iam/v1;iam", + "java_multiple_files": true, + "java_outer_classname": "PolicyProto", + "java_package": "com.google.iam.v1", + "php_namespace": "Google\\Cloud\\Iam\\V1" + }, + "nested": { + "Policy": { + "fields": { + "version": { + "type": "int32", + "id": 1 + }, + "bindings": { + "rule": "repeated", + "type": "Binding", + "id": 4 + }, + "etag": { + "type": "bytes", + "id": 3 + } + } + }, + "Binding": { + "fields": { + "role": { + "type": "string", + "id": 1 + }, + "members": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "condition": { + "type": "google.type.Expr", + "id": 3 + } + } + }, + "PolicyDelta": { + "fields": { + "bindingDeltas": { + "rule": "repeated", + "type": "BindingDelta", + "id": 1 + }, + "auditConfigDeltas": { + "rule": "repeated", + "type": "AuditConfigDelta", + "id": 2 + } + } + }, + "BindingDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "role": { + "type": "string", + "id": 2 + }, + "member": { + "type": "string", + "id": 3 + }, + "condition": { + "type": "google.type.Expr", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + }, + "AuditConfigDelta": { + "fields": { + "action": { + "type": "Action", + "id": 1 + }, + "service": { + "type": "string", + "id": 2 + }, + "exemptedMember": { + "type": "string", + "id": 3 + }, + "logType": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Action": { + "values": { + "ACTION_UNSPECIFIED": 0, + "ADD": 1, + "REMOVE": 2 + } + } + } + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/expr;expr", + "java_multiple_files": true, + "java_outer_classname": "ExprProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "Expr": { + "fields": { + "expression": { + "type": "string", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "location": { + "type": "string", + "id": 4 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js new file mode 100644 index 00000000000..b09e4d001ec --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance's project and location in the format + * projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The name of the instance to create. + */ + // const instanceId = 'abc123' + /** + * An instance resource. + */ + // const instance = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function createInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END datafusion_v1_generated_DataFusion_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js new file mode 100644 index 00000000000..cde15d47f32 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function deleteInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END datafusion_v1_generated_DataFusion_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js new file mode 100644 index 00000000000..1945250c1b5 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function getInstance() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END datafusion_v1_generated_DataFusion_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js new file mode 100644 index 00000000000..9d43499b31a --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1_generated_DataFusion_ListAvailableVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + */ + // const latestPatchOnly = true + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listAvailableVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listAvailableVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAvailableVersions(); + // [END datafusion_v1_generated_DataFusion_ListAvailableVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js new file mode 100644 index 00000000000..be588b26034 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listInstances() { + // Construct request + const request = { + }; + + // Run request + const iterable = await datafusionClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END datafusion_v1_generated_DataFusion_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js new file mode 100644 index 00000000000..a879d529a74 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_RestartInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function restartInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restartInstance(); + // [END datafusion_v1_generated_DataFusion_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js new file mode 100644 index 00000000000..f25496040e9 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + */ + // const instance = '' + /** + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + */ + // const updateMask = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function updateInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END datafusion_v1_generated_DataFusion_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js new file mode 100644 index 00000000000..81fb01a370a --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which DNS peering will be created. + */ + // const parent = 'abc123' + /** + * Dns peering config. + */ + // const dnsPeering = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function addDnsPeering() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.addDnsPeering(request); + console.log(response); + } + + addDnsPeering(); + // [END datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js new file mode 100644 index 00000000000..1f88908871d --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance's project and location in the format + * projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The name of the instance to create. + */ + // const instanceId = 'abc123' + /** + * An instance resource. + */ + // const instance = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function createInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END datafusion_v1beta1_generated_DataFusion_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js new file mode 100644 index 00000000000..e03cda45f63 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function deleteInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js new file mode 100644 index 00000000000..c1719b4ac00 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function getInstance() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END datafusion_v1beta1_generated_DataFusion_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js new file mode 100644 index 00000000000..2c7920b4aef --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + */ + // const latestPatchOnly = true + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listAvailableVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listAvailableVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAvailableVersions(); + // [END datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js new file mode 100644 index 00000000000..1fbf286ba83 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource on which dns peering will be listed. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listDnsPeerings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listDnsPeeringsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listDnsPeerings(); + // [END datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js new file mode 100644 index 00000000000..7ead3148fbc --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listInstances() { + // Construct request + const request = { + }; + + // Run request + const iterable = await datafusionClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END datafusion_v1beta1_generated_DataFusion_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js new file mode 100644 index 00000000000..f93b9a5622a --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance to list its namespaces. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + */ + // const view = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listNamespaces() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listNamespacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listNamespaces(); + // [END datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js new file mode 100644 index 00000000000..1fb6a727dca --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(zone) { + // [START datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which DNS peering will be removed. + */ + // const parent = 'abc123' + /** + * Required. The zone to be removed. + */ + // const zone = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function removeDnsPeering() { + // Construct request + const request = { + zone, + }; + + // Run request + const response = await datafusionClient.removeDnsPeering(request); + console.log(response); + } + + removeDnsPeering(); + // [END datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js new file mode 100644 index 00000000000..ed5f2043bf4 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which IAM policy to be removed is attached to. + */ + // const resource = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function removeIamPolicy() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.removeIamPolicy(request); + console.log(response); + } + + removeIamPolicy(); + // [END datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js new file mode 100644 index 00000000000..61720548f38 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_RestartInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function restartInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restartInstance(); + // [END datafusion_v1beta1_generated_DataFusion_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js new file mode 100644 index 00000000000..d04f0db8b0e --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + */ + // const instance = '' + /** + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + */ + // const updateMask = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function updateInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js new file mode 100644 index 00000000000..888f2e90b56 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be upgraded in the form of + * projects/{project}/locations/{location}/instances/{instance} + * Instance will be upgraded with the latest stable version of the Data + * Fusion. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function upgradeInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.upgradeInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + upgradeInstance(); + // [END datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json new file mode 100644 index 00000000000..c024366b7f0 --- /dev/null +++ b/packages/google-cloud-datafusion/samples/package.json @@ -0,0 +1,23 @@ +{ + "name": "nodejs-data-fusion", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=10" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/data-fusion": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.1.0", + "chai": "^4.2.0", + "mocha": "^8.0.0" + } +} diff --git a/packages/google-cloud-datafusion/samples/quickstart.js b/packages/google-cloud-datafusion/samples/quickstart.js new file mode 100644 index 00000000000..ab3680fc9cf --- /dev/null +++ b/packages/google-cloud-datafusion/samples/quickstart.js @@ -0,0 +1,50 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +'use strict'; + +async function main() { + + // [START nodejs_data_fusion_quickstart] + // Imports the Google Cloud client library + + // remove this line after package is released + // eslint-disable-next-line node/no-missing-require + const {DataFusionClient} = require('@google-cloud/data-fusion'); + + // TODO(developer): replace with your prefered project ID. + // const projectId = 'my-project' + + // Creates a client + // eslint-disable-next-line no-unused-vars + const client = new {DataFusionClient}(); + + //TODO(library generator): write the actual function you will be testing + async function doSomething() { + console.log('DPE! Change this code so that it shows how to use the library! See comments below on structure.') + // const [thing] = await client.methodName({ + // }); + // console.info(thing); + } + doSomething(); + // [END nodejs_data_fusion_quickstart] +} + +main(...process.argv.slice(2)).catch(err => { + console.error(err.message); + process.exitCode = 1; +}); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-datafusion/samples/test/quickstart.js b/packages/google-cloud-datafusion/samples/test/quickstart.js new file mode 100644 index 00000000000..037c142f63e --- /dev/null +++ b/packages/google-cloud-datafusion/samples/test/quickstart.js @@ -0,0 +1,53 @@ +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +const path = require('path'); +const cp = require('child_process'); +const {before, describe, it} = require('mocha'); +// eslint-disable-next-line node/no-missing-require +const {DataFusionClient} = require('@google-cloud/data-fusion'); +// eslint-disable-next-line no-unused-vars, node/no-missing-require +const {assert} = require('chai'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const client = new {DataFusionClient}(); + +describe('Quickstart', () => { + //TODO: remove this if not using the projectId + // eslint-disable-next-line no-unused-vars + let projectId; + + before(async () => { + // eslint-disable-next-line no-unused-vars + projectId = await client.getProjectId(); + }); + + it('should run quickstart', async () => { + //TODO: remove this line + // eslint-disable-next-line no-unused-vars + const stdout = execSync( + `node ./quickstart.js`, + {cwd} + ); + //assert(stdout, stdout !== null); + }); +}); diff --git a/packages/google-cloud-datafusion/src/index.ts b/packages/google-cloud-datafusion/src/index.ts new file mode 100644 index 00000000000..8a98e087453 --- /dev/null +++ b/packages/google-cloud-datafusion/src/index.ts @@ -0,0 +1,28 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by synthtool. ** +// ** https://github.com/googleapis/synthtool ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +import * as v1beta1 from './v1beta1'; + +const DataFusionClient = v1.DataFusionClient; +type DataFusionClient = v1.DataFusionClient; + +export {v1, v1beta1, DataFusionClient}; +export default {v1, v1beta1, DataFusionClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts new file mode 100644 index 00000000000..fe982d87cca --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -0,0 +1,1286 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/data_fusion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_fusion_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for creating and managing Data Fusion instances. + * Data Fusion enables ETL developers to build code-free, data integration + * pipelines via a point-and-click UI. + * @class + * @memberof v1 + */ +export class DataFusionClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataFusionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataFusionClient. + * + * @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/master/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} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataFusionClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + }; + + // 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 = { + listAvailableVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances') + }; + + 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. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datafusion.v1.DataFusion', 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 = gax.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.dataFusionStub) { + return this.dataFusionStub; + } + + // Put together the "service stub" for + // google.cloud.datafusion.v1.DataFusion. + this.dataFusionStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1.DataFusion') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datafusion.v1.DataFusion, + 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 dataFusionStubMethods = + ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance']; + for (const methodName of dataFusionStubMethods) { + const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.dataFusionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datafusion.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 'datafusion.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 -- + // ------------------- + getInstance( + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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.getInstance(request); + */ + getInstance( + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ + createInstance( + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + deleteInstance( + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a single Date Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + updateInstance( + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ + updateInstance( + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + restartInstance( + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ + restartInstance( + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ]>; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): void; +/** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): + Promise<[ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersionsStream( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.createStream( + this.innerApiCalls.listAvailableVersions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAvailableVersionsAsync( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.asyncIterate( + this.innerApiCalls['listAvailableVersions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): void; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): void; +/** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ + listInstances( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance} 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 `listInstancesAsync()` + * 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. + */ + listInstancesStream( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.dataFusionStub!.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client_config.json b/packages/google-cloud-datafusion/src/v1/data_fusion_client_config.json new file mode 100644 index 00000000000..531f4845eab --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.datafusion.v1.DataFusion": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAvailableVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/src/v1/data_fusion_proto_list.json new file mode 100644 index 00000000000..b7898b94f83 --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/datafusion/v1/datafusion.proto" +] diff --git a/packages/google-cloud-datafusion/src/v1/gapic_metadata.json b/packages/google-cloud-datafusion/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..b2dd33303e9 --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1/gapic_metadata.json @@ -0,0 +1,101 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.datafusion.v1", + "libraryPackage": "@google-cloud/datafusion", + "services": { + "DataFusion": { + "clients": { + "grpc": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/src/v1/index.ts b/packages/google-cloud-datafusion/src/v1/index.ts new file mode 100644 index 00000000000..6dd78dbfb06 --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts new file mode 100644 index 00000000000..ea8fc9ee7d2 --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -0,0 +1,2054 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/data_fusion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_fusion_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for creating and managing Data Fusion instances. + * Data Fusion enables ETL developers to build code-free, data integration + * pipelines via a point-and-click UI. + * @class + * @memberof v1beta1 + */ +export class DataFusionClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataFusionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataFusionClient. + * + * @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/master/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} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataFusionClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + namespacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}' + ), + }; + + // 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 = { + listAvailableVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listNamespaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'namespaces'), + listDnsPeerings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dnsPeerings') + }; + + 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. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const upgradeInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const upgradeInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + upgradeInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeInstanceResponse.decode.bind(upgradeInstanceResponse), + upgradeInstanceMetadata.decode.bind(upgradeInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datafusion.v1beta1.DataFusion', 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 = gax.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.dataFusionStub) { + return this.dataFusionStub; + } + + // Put together the "service stub" for + // google.cloud.datafusion.v1beta1.DataFusion. + this.dataFusionStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1beta1.DataFusion') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datafusion.v1beta1.DataFusion, + 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 dataFusionStubMethods = + ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance', 'upgradeInstance', 'removeIamPolicy', 'listNamespaces', 'addDnsPeering', 'removeDnsPeering', 'listDnsPeerings']; + for (const methodName of dataFusionStubMethods) { + const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.dataFusionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datafusion.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 'datafusion.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 -- + // ------------------- + getInstance( + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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.getInstance(request); + */ + getInstance( + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + removeIamPolicy( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|undefined, {}|undefined + ]>; + removeIamPolicy( + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + removeIamPolicy( + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Remove IAM policy that is currently set on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * The resource on which IAM policy to be removed is attached to. + * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. + * 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.removeIamPolicy(request); + */ + removeIamPolicy( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|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' + ] = gax.routingHeader.fromParams({ + 'resource': request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.removeIamPolicy(request, options, callback); + } + addDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|undefined, {}|undefined + ]>; + addDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; + addDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; +/** + * Add DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be created. + * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering + * Dns peering config. + * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. + * 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.addDnsPeering(request); + */ + addDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.addDnsPeering(request, options, callback); + } + removeDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|undefined, {}|undefined + ]>; + removeDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; + removeDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; +/** + * Remove DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be removed. + * @param {string} request.zone + * Required. The zone to be removed. + * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. + * 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.removeDnsPeering(request); + */ + removeDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.removeDnsPeering(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ + createInstance( + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + deleteInstance( + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + updateInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ + updateInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + restartInstance( + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ + restartInstance( + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + upgradeInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Upgrade a single Data Fusion instance. + * At the end of an operation instance is fully upgraded. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be upgraded in the form of + * projects/{project}/locations/{location}/instances/{instance} + * Instance will be upgraded with the latest stable version of the Data + * Fusion. + * @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 + * const [operation] = await client.upgradeInstance(request); + * const [response] = await operation.promise(); + */ + upgradeInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.upgradeInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `upgradeInstance()`. + * @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 + * const decodedOperation = await checkUpgradeInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpgradeInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.upgradeInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ]>; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): void; +/** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersionsStream( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.createStream( + this.innerApiCalls.listAvailableVersions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1beta1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAvailableVersionsAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.asyncIterate( + this.innerApiCalls['listAvailableVersions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): void; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): void; +/** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ + listInstances( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance} 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 `listInstancesAsync()` + * 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. + */ + listInstancesStream( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listNamespaces( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ]>; + listNamespaces( + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): void; + listNamespaces( + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): void; +/** + * List namespaces in a given instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. + * 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 `listNamespacesAsync()` + * 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. + */ + listNamespaces( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listNamespaces(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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace} 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 `listNamespacesAsync()` + * 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. + */ + listNamespacesStream( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listNamespaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNamespaces.createStream( + this.innerApiCalls.listNamespaces as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNamespaces`, 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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 + * [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. 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.listNamespacesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listNamespacesAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listNamespaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNamespaces.asyncIterate( + this.innerApiCalls['listNamespaces'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listDnsPeerings( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ]>; + listDnsPeerings( + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; + listDnsPeerings( + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; +/** + * List DNS peering for a given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. + * 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 `listDnsPeeringsAsync()` + * 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. + */ + listDnsPeerings( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDnsPeerings(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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering} 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 `listDnsPeeringsAsync()` + * 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. + */ + listDnsPeeringsStream( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDnsPeerings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsPeerings.createStream( + this.innerApiCalls.listDnsPeerings as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDnsPeerings`, 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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 + * [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. 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.listDnsPeeringsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listDnsPeeringsAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listDnsPeerings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsPeerings.asyncIterate( + this.innerApiCalls['listDnsPeerings'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified namespace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} namespace + * @returns {string} Resource name string. + */ + namespacePath(project:string,location:string,instance:string,namespace:string) { + return this.pathTemplates.namespacePathTemplate.render({ + project: project, + location: location, + instance: instance, + namespace: namespace, + }); + } + + /** + * Parse the project from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).project; + } + + /** + * Parse the location from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).location; + } + + /** + * Parse the instance from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).instance; + } + + /** + * Parse the namespace from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the namespace. + */ + matchNamespaceFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).namespace; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.dataFusionStub!.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client_config.json b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client_config.json new file mode 100644 index 00000000000..fb09a3c732a --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.datafusion.v1beta1.DataFusion": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAvailableVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNamespaces": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddDnsPeering": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDnsPeering": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDnsPeerings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_proto_list.json new file mode 100644 index 00000000000..ea2e94605fb --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/datafusion/v1beta1/v1beta1.proto" +] diff --git a/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json b/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..24ee6be68aa --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json @@ -0,0 +1,169 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.datafusion.v1beta1", + "libraryPackage": "@google-cloud/datafusion", + "services": { + "DataFusion": { + "clients": { + "grpc": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "RemoveIamPolicy": { + "methods": [ + "removeIamPolicy" + ] + }, + "AddDnsPeering": { + "methods": [ + "addDnsPeering" + ] + }, + "RemoveDnsPeering": { + "methods": [ + "removeDnsPeering" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgradeInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListNamespaces": { + "methods": [ + "listNamespaces", + "listNamespacesStream", + "listNamespacesAsync" + ] + }, + "ListDnsPeerings": { + "methods": [ + "listDnsPeerings", + "listDnsPeeringsStream", + "listDnsPeeringsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "RemoveIamPolicy": { + "methods": [ + "removeIamPolicy" + ] + }, + "AddDnsPeering": { + "methods": [ + "addDnsPeering" + ] + }, + "RemoveDnsPeering": { + "methods": [ + "removeDnsPeering" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgradeInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListNamespaces": { + "methods": [ + "listNamespaces", + "listNamespacesStream", + "listNamespacesAsync" + ] + }, + "ListDnsPeerings": { + "methods": [ + "listDnsPeerings", + "listDnsPeeringsStream", + "listDnsPeeringsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/src/v1beta1/index.ts b/packages/google-cloud-datafusion/src/v1beta1/index.ts new file mode 100644 index 00000000000..6dd78dbfb06 --- /dev/null +++ b/packages/google-cloud-datafusion/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1efd2377537 --- /dev/null +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datafusion = require('@google-cloud/datafusion'); + +function main() { + const dataFusionClient = new datafusion.DataFusionClient(); +} + +main(); diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..39d8d911158 --- /dev/null +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataFusionClient} from '@google-cloud/datafusion'; + +// check that the client class type name can be used +function doStuffWithDataFusionClient(client: DataFusionClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataFusionClient = new DataFusionClient(); + doStuffWithDataFusionClient(dataFusionClient); +} + +main(); diff --git a/packages/google-cloud-datafusion/system-test/install.ts b/packages/google-cloud-datafusion/system-test/install.ts new file mode 100644 index 00000000000..1f850b522f3 --- /dev/null +++ b/packages/google-cloud-datafusion/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts new file mode 100644 index 00000000000..265b14310df --- /dev/null +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -0,0 +1,1342 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 datafusionModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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.DataFusionClient', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1.DataFusionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1.DataFusionClient({ + 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 datafusionModule.v1.DataFusionClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAvailableVersions(request), expectedError); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { + 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.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('instance', () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts new file mode 100644 index 00000000000..db993ba4c82 --- /dev/null +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -0,0 +1,2238 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 datafusionModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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('v1beta1.DataFusionClient', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1beta1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1beta1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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 datafusionModule.v1beta1.DataFusionClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('removeIamPolicy', () => { + it('invokes removeIamPolicy without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); + client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.removeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeIamPolicy without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); + client.innerApiCalls.removeIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeIamPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeIamPolicy with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeIamPolicy(request), expectedError); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('addDnsPeering', () => { + it('invokes addDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); + client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.addDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); + client.innerApiCalls.addDnsPeering = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addDnsPeering( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addDnsPeering = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addDnsPeering(request), expectedError); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('removeDnsPeering', () => { + it('invokes removeDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); + client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.removeDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); + client.innerApiCalls.removeDnsPeering = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDnsPeering( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDnsPeering = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDnsPeering(request), expectedError); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('upgradeInstance', () => { + it('invokes upgradeInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes upgradeInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.upgradeInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes upgradeInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.upgradeInstance(request), expectedError); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes upgradeInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.upgradeInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpgradeInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAvailableVersions(request), expectedError); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { + 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.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNamespaces', () => { + it('invokes listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); + const [response] = await client.listNamespaces(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listNamespaces without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.innerApiCalls.listNamespaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNamespaces( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.INamespace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNamespaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNamespaces(request), expectedError); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listNamespacesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + 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.listNamespaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); + assert.strictEqual( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listNamespacesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); + assert.strictEqual( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; + const iterable = client.listNamespacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNamespacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDnsPeerings', () => { + it('invokes listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); + const [response] = await client.listDnsPeerings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDnsPeerings without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.innerApiCalls.listDnsPeerings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDnsPeerings( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IDnsPeering[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDnsPeerings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDnsPeerings(request), expectedError); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDnsPeeringsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + 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.listDnsPeerings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDnsPeeringsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; + const iterable = client.listDnsPeeringsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDnsPeeringsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('instance', () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('namespace', () => { + const fakePath = "/rendered/path/namespace"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + namespace: "namespaceValue", + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.namespacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.namespacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('namespacePath', () => { + const result = client.namespacePath("projectValue", "locationValue", "instanceValue", "namespaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.namespacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNamespaceName', () => { + const result = client.matchProjectFromNamespaceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNamespaceName', () => { + const result = client.matchLocationFromNamespaceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromNamespaceName', () => { + const result = client.matchInstanceFromNamespaceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNamespaceFromNamespaceName', () => { + const result = client.matchNamespaceFromNamespaceName(fakePath); + assert.strictEqual(result, "namespaceValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-datafusion/tsconfig.json b/packages/google-cloud-datafusion/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-datafusion/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-datafusion/v1/.eslintignore b/packages/google-cloud-datafusion/v1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/google-cloud-datafusion/v1/.eslintrc.json b/packages/google-cloud-datafusion/v1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-datafusion/v1/.gitignore b/packages/google-cloud-datafusion/v1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.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-datafusion/v1/.jsdoc.js b/packages/google-cloud-datafusion/v1/.jsdoc.js new file mode 100644 index 00000000000..37689bedd59 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/datafusion', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-datafusion/v1/.mocharc.js b/packages/google-cloud-datafusion/v1/.mocharc.js new file mode 100644 index 00000000000..50bc7f79235 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +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-datafusion/v1/.prettierrc.js b/packages/google-cloud-datafusion/v1/.prettierrc.js new file mode 100644 index 00000000000..84f4713a055 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-datafusion/v1/README.md b/packages/google-cloud-datafusion/v1/README.md new file mode 100644 index 00000000000..a92302cfdbe --- /dev/null +++ b/packages/google-cloud-datafusion/v1/README.md @@ -0,0 +1 @@ +Datafusion: Nodejs Client diff --git a/packages/google-cloud-datafusion/v1/linkinator.config.json b/packages/google-cloud-datafusion/v1/linkinator.config.json new file mode 100644 index 00000000000..29a223b6db6 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-datafusion/v1/package.json b/packages/google-cloud-datafusion/v1/package.json new file mode 100644 index 00000000000..91794b18fed --- /dev/null +++ b/packages/google-cloud-datafusion/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/datafusion", + "version": "0.1.0", + "description": "Datafusion client for Node.js", + "repository": "googleapis/nodejs-datafusion", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google datafusion", + "datafusion", + "data fusion" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.19.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^14.17.3", + "@types/sinon": "^10.0.2", + "c8": "^7.7.3", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.0", + "jsdoc-region-tag": "^1.1.0", + "linkinator": "^2.13.6", + "mocha": "^9.0.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^11.1.1", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", + "webpack": "^5.39.1", + "webpack-cli": "^4.7.2" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto b/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto new file mode 100644 index 00000000000..aae228337b8 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto @@ -0,0 +1,519 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datafusion.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.DataFusion.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1;datafusion"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datafusion.v1"; +option php_namespace = "Google\\Cloud\\DataFusion\\V1"; +option ruby_package = "Google::Cloud::DataFusion::V1"; + +// Service for creating and managing Data Fusion instances. +// Data Fusion enables ETL developers to build code-free, data integration +// pipelines via a point-and-click UI. +service DataFusion { + option (google.api.default_host) = "datafusion.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists possible versions for Data Fusion instances in the specified project + // and location. + rpc ListAvailableVersions(ListAvailableVersionsRequest) + returns (ListAvailableVersionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Data Fusion instances in the specified project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + } + + // Gets details of a single Data Fusion instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + } + + // Creates a new Data Fusion instance in the specified project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Date Fusion instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a single Data Fusion instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart a single Data Fusion instance. + // At the end of an operation instance is fully restarted. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } +} + +// Network configuration for a Data Fusion instance. These configurations +// are used for peering with the customer network. Configurations are optional +// when a public Data Fusion instance is to be created. However, providing +// these configurations allows several benefits, such as reduced network latency +// while accessing the customer resources from managed Data Fusion instance +// nodes, as well as access to the customer on-prem resources. +message NetworkConfig { + // Name of the network in the customer project with which the Tenant Project + // will be peered for executing pipelines. In case of shared VPC where the + // network resides in another host project the network should specified in + // the form of projects/{host-project-id}/global/networks/{network} + string network = 1; + + // The IP range in CIDR notation to use for the managed Data Fusion instance + // nodes. This range must not overlap with any other ranges used in the + // customer network. + string ip_allocation = 2; +} + +// The Data Fusion version. This proto message stores information about certain +// Data Fusion version, which is used for Data Fusion version upgrade. +message Version { + // The version number of the Data Fusion instance, such as '6.0.1.0'. + string version_number = 1; + + // Whether this is currently the default version for Cloud Data Fusion + bool default_version = 2; + + // Represents a list of available feature names for a given version. + repeated string available_features = 3; +} + +// Identifies Data Fusion accelerators for an instance. +message Accelerator { + // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion + // service. + enum AcceleratorType { + // Default value, if unspecified. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Change Data Capture accelerator for CDF. + CDC = 1; + + // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud + // Healthcare specific CDF plugins developed by Healthcare team. + HEALTHCARE = 2; + + // Contact Center AI Insights + // This accelerator is used to enable import and export pipelines + // custom built to streamline CCAI Insights processing. + CCAI_INSIGHTS = 3; + } + + // Different values possible for the state of an accelerator + enum State { + // Default value, do not use + STATE_UNSPECIFIED = 0; + + // Indicates that the accelerator is enabled and available to use + ENABLED = 1; + + // Indicates that the accelerator is disabled and not available to use + DISABLED = 2; + + // Indicates that accelerator state is currently unknown. + // Requests for enable, disable could be retried while in this state + UNKNOWN = 3; + } + + // The type of an accelator for a CDF instance. + AcceleratorType accelerator_type = 1; + + // The state of the accelerator + State state = 2; +} + +// The crypto key configuration. This field is used by the Customer-managed +// encryption keys (CMEK) feature. +message CryptoKeyConfig { + // The name of the key which is used to encrypt/decrypt customer data. For key + // in Cloud KMS, the key should be in the format of + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string key_reference = 1; +} + +// Represents a Data Fusion instance. +message Instance { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Represents the type of Data Fusion instance. Each type is configured with + // the default settings for processing and memory. + enum Type { + // No type specified. The instance creation will fail. + TYPE_UNSPECIFIED = 0; + + // Basic Data Fusion instance. In Basic type, the user will be able to + // create data pipelines using point and click UI. However, there are + // certain limitations, such as fewer number of concurrent pipelines, no + // support for streaming pipelines, etc. + BASIC = 1; + + // Enterprise Data Fusion instance. In Enterprise type, the user will have + // all features available, such as support for streaming pipelines, higher + // number of concurrent pipelines, etc. + ENTERPRISE = 2; + + // Developer Data Fusion instance. In Developer type, the user will have all + // features available but with restrictive capabilities. This is to help + // enterprises design and develop their data ingestion and integration + // pipelines at low cost. + DEVELOPER = 3; + } + + // Represents the state of a Data Fusion instance + enum State { + // Instance does not have a state yet + STATE_UNSPECIFIED = 0; + + // Instance is being created + CREATING = 1; + + // Instance is active and ready for requests. This corresponds to 'RUNNING' + // in datafusion.v1beta1. + ACTIVE = 2; + + // Instance creation failed + FAILED = 3; + + // Instance is being deleted + DELETING = 4; + + // Instance is being upgraded + UPGRADING = 5; + + // Instance is being restarted + RESTARTING = 6; + + // Instance is being updated on customer request + UPDATING = 7; + + // Instance is being auto-updated + AUTO_UPDATING = 8; + + // Instance is being auto-upgraded + AUTO_UPGRADING = 9; + } + + // Output only. The name of this instance is in the form of + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of this instance. + string description = 2; + + // Required. Instance type. + Type type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Option to enable Stackdriver Logging. + bool enable_stackdriver_logging = 4; + + // Option to enable Stackdriver Monitoring. + bool enable_stackdriver_monitoring = 5; + + // Specifies whether the Data Fusion instance should be private. If set to + // true, all Data Fusion nodes will have private IP addresses and will not be + // able to access the public internet. + bool private_instance = 6; + + // Network configuration options. These are required when a private Data + // Fusion instance is to be created. + NetworkConfig network_config = 7; + + // The resource labels for instance to use to annotate any related underlying + // resources such as Compute Engine VMs. The character '=' is not allowed to + // be used within the labels. + map labels = 8; + + // Map of additional options used to configure the behavior of + // Data Fusion instance. + map options = 9; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this Data Fusion instance. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of this Data + // Fusion instance if available. + string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Endpoint on which the Data Fusion UI is accessible. + string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the zone in which the Data Fusion instance will be created. Only + // DEVELOPER instances use this field. + string zone = 15; + + // Current version of the Data Fusion. Only specifiable in Update. + string version = 16; + + // Output only. Deprecated. Use tenant_project_id instead to extract the + // tenant project ID. + string service_account = 17 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name for an instance. + string display_name = 18; + + // Available versions that the instance can be upgraded to using + // UpdateInstanceRequest. + repeated Version available_version = 19; + + // Output only. Endpoint on which the REST APIs is accessible. + string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Storage bucket generated by Data Fusion in the customer + // project. + string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of accelerators enabled for this CDF instance. + repeated Accelerator accelerators = 22; + + // Output only. P4 service account for the customer project. + string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the tenant project. + string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-managed service account to set on Dataproc when Cloud Data Fusion + // creates Dataproc to run data processing pipelines. + // + // This allows users to have fine-grained access control on Dataproc's + // accesses to cloud resources. + string dataproc_service_account = 25; + + // Option to enable granular role-based access control. + bool enable_rbac = 27; + + // The crypto key configuration. This field is used by the Customer-Managed + // Encryption Keys (CMEK) feature. + CryptoKeyConfig crypto_key_config = 28; +} + +// Request message for listing Data Fusion instances. +message ListInstancesRequest { + // The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. If the location is + // specified as '-' (wildcard), then all regions available to the project + // are queried, and the results are aggregated. + string parent = 1; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // List filter. + string filter = 4; + + // Sort results. Supported values are "name", "name desc", or "" (unsorted). + string order_by = 5; +} + +// Response message for the list instance request. +message ListInstancesResponse { + // Represents a list of Data Fusion instances. + repeated Instance instances = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for the list available versions request. +message ListAvailableVersionsRequest { + // Required. The project and location for which to retrieve instance + // information in the format projects/{project}/locations/{location}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Whether or not to return the latest patch of every available minor version. + // If true, only the latest patch will be returned. Ex. if allowed versions is + // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + bool latest_patch_only = 4; +} + +// Response message for the list available versions request. +message ListAvailableVersionsResponse { + // Represents a list of versions that are supported. + repeated Version available_versions = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for getting details about a Data Fusion instance. +message GetInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; +} + +// Request message for creating a Data Fusion instance. +message CreateInstanceRequest { + // The instance's project and location in the format + // projects/{project}/locations/{location}. + string parent = 1; + + // The name of the instance to create. + string instance_id = 2; + + // An instance resource. + Instance instance = 3; +} + +// Request message for deleting a Data Fusion instance. +message DeleteInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +message UpdateInstanceRequest { + // The instance resource that replaces the resource on the server. Currently, + // Data Fusion only allows replacing labels, options, and stack driver + // settings. All other fields will be ignored. + Instance instance = 1; + + // Field mask is used to specify the fields that the update will overwrite + // in an instance resource. 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, all the supported fields (labels, + // options, and version currently) will be overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for restarting a Data Fusion instance. +message RestartInstanceRequest { + // Name of the Data Fusion instance which need to be restarted in the form of + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; + + // Map to hold any additional status info for the operation + // If there is an accelerator being enabled/disabled/deleted, this will be + // populated with accelerator name as key and status as + // ENABLING, DISABLING or DELETING + map additional_status = 8; +} diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js new file mode 100644 index 00000000000..b09e4d001ec --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance's project and location in the format + * projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The name of the instance to create. + */ + // const instanceId = 'abc123' + /** + * An instance resource. + */ + // const instance = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function createInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END datafusion_v1_generated_DataFusion_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js new file mode 100644 index 00000000000..cde15d47f32 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function deleteInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END datafusion_v1_generated_DataFusion_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js new file mode 100644 index 00000000000..1945250c1b5 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function getInstance() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END datafusion_v1_generated_DataFusion_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js new file mode 100644 index 00000000000..9d43499b31a --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1_generated_DataFusion_ListAvailableVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + */ + // const latestPatchOnly = true + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listAvailableVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listAvailableVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAvailableVersions(); + // [END datafusion_v1_generated_DataFusion_ListAvailableVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js new file mode 100644 index 00000000000..be588b26034 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listInstances() { + // Construct request + const request = { + }; + + // Run request + const iterable = await datafusionClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END datafusion_v1_generated_DataFusion_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js new file mode 100644 index 00000000000..a879d529a74 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_RestartInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function restartInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restartInstance(); + // [END datafusion_v1_generated_DataFusion_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js new file mode 100644 index 00000000000..f25496040e9 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1_generated_DataFusion_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + */ + // const instance = '' + /** + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + */ + // const updateMask = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function updateInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END datafusion_v1_generated_DataFusion_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/src/index.ts b/packages/google-cloud-datafusion/v1/src/index.ts new file mode 100644 index 00000000000..5fa9f20abbc --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const DataFusionClient = v1.DataFusionClient; +type DataFusionClient = v1.DataFusionClient; +export {v1, DataFusionClient}; +export default {v1, DataFusionClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts new file mode 100644 index 00000000000..fe982d87cca --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts @@ -0,0 +1,1286 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/data_fusion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_fusion_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for creating and managing Data Fusion instances. + * Data Fusion enables ETL developers to build code-free, data integration + * pipelines via a point-and-click UI. + * @class + * @memberof v1 + */ +export class DataFusionClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataFusionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataFusionClient. + * + * @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/master/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} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataFusionClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + }; + + // 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 = { + listAvailableVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances') + }; + + 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. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datafusion.v1.DataFusion', 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 = gax.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.dataFusionStub) { + return this.dataFusionStub; + } + + // Put together the "service stub" for + // google.cloud.datafusion.v1.DataFusion. + this.dataFusionStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1.DataFusion') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datafusion.v1.DataFusion, + 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 dataFusionStubMethods = + ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance']; + for (const methodName of dataFusionStubMethods) { + const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.dataFusionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datafusion.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 'datafusion.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 -- + // ------------------- + getInstance( + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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.getInstance(request); + */ + getInstance( + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ + createInstance( + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + deleteInstance( + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a single Date Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + updateInstance( + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ + updateInstance( + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + restartInstance( + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ + restartInstance( + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ]>; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): void; +/** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1.IVersion>): + Promise<[ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersionsStream( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.createStream( + this.innerApiCalls.listAvailableVersions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAvailableVersionsAsync( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.asyncIterate( + this.innerApiCalls['listAvailableVersions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): void; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): void; +/** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ + listInstances( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1.IInstance>): + Promise<[ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance} 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 `listInstancesAsync()` + * 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. + */ + listInstancesStream( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.dataFusionStub!.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json new file mode 100644 index 00000000000..531f4845eab --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json @@ -0,0 +1,61 @@ +{ + "interfaces": { + "google.cloud.datafusion.v1.DataFusion": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAvailableVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json new file mode 100644 index 00000000000..b7898b94f83 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/datafusion/v1/datafusion.proto" +] diff --git a/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json b/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..b2dd33303e9 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json @@ -0,0 +1,101 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.datafusion.v1", + "libraryPackage": "@google-cloud/datafusion", + "services": { + "DataFusion": { + "clients": { + "grpc": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/v1/src/v1/index.ts b/packages/google-cloud-datafusion/v1/src/v1/index.ts new file mode 100644 index 00000000000..6dd78dbfb06 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1efd2377537 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datafusion = require('@google-cloud/datafusion'); + +function main() { + const dataFusionClient = new datafusion.DataFusionClient(); +} + +main(); diff --git a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..39d8d911158 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataFusionClient} from '@google-cloud/datafusion'; + +// check that the client class type name can be used +function doStuffWithDataFusionClient(client: DataFusionClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataFusionClient = new DataFusionClient(); + doStuffWithDataFusionClient(dataFusionClient); +} + +main(); diff --git a/packages/google-cloud-datafusion/v1/system-test/install.ts b/packages/google-cloud-datafusion/v1/system-test/install.ts new file mode 100644 index 00000000000..1f850b522f3 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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-datafusion/v1/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts new file mode 100644 index 00000000000..265b14310df --- /dev/null +++ b/packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts @@ -0,0 +1,1342 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 datafusionModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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.DataFusionClient', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1.DataFusionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1.DataFusionClient({ + 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 datafusionModule.v1.DataFusionClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAvailableVersions(request), expectedError); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { + 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.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('instance', () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-datafusion/v1/tsconfig.json b/packages/google-cloud-datafusion/v1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-datafusion/v1/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-datafusion/v1/webpack.config.js b/packages/google-cloud-datafusion/v1/webpack.config.js new file mode 100644 index 00000000000..7346a1e4405 --- /dev/null +++ b/packages/google-cloud-datafusion/v1/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: 'DataFusion', + filename: './data-fusion.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/packages/google-cloud-datafusion/v1beta1/.eslintignore b/packages/google-cloud-datafusion/v1beta1/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/packages/google-cloud-datafusion/v1beta1/.eslintrc.json b/packages/google-cloud-datafusion/v1beta1/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-datafusion/v1beta1/.gitignore b/packages/google-cloud-datafusion/v1beta1/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.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-datafusion/v1beta1/.jsdoc.js b/packages/google-cloud-datafusion/v1beta1/.jsdoc.js new file mode 100644 index 00000000000..37689bedd59 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +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 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/datafusion', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-datafusion/v1beta1/.mocharc.js b/packages/google-cloud-datafusion/v1beta1/.mocharc.js new file mode 100644 index 00000000000..50bc7f79235 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +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-datafusion/v1beta1/.prettierrc.js b/packages/google-cloud-datafusion/v1beta1/.prettierrc.js new file mode 100644 index 00000000000..84f4713a055 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// 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. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/packages/google-cloud-datafusion/v1beta1/README.md b/packages/google-cloud-datafusion/v1beta1/README.md new file mode 100644 index 00000000000..a92302cfdbe --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/README.md @@ -0,0 +1 @@ +Datafusion: Nodejs Client diff --git a/packages/google-cloud-datafusion/v1beta1/linkinator.config.json b/packages/google-cloud-datafusion/v1beta1/linkinator.config.json new file mode 100644 index 00000000000..29a223b6db6 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-datafusion/v1beta1/package.json b/packages/google-cloud-datafusion/v1beta1/package.json new file mode 100644 index 00000000000..91794b18fed --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/datafusion", + "version": "0.1.0", + "description": "Datafusion client for Node.js", + "repository": "googleapis/nodejs-datafusion", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google datafusion", + "datafusion", + "data fusion" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.19.0" + }, + "devDependencies": { + "@types/mocha": "^9.0.0", + "@types/node": "^14.17.3", + "@types/sinon": "^10.0.2", + "c8": "^7.7.3", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.0", + "jsdoc-region-tag": "^1.1.0", + "linkinator": "^2.13.6", + "mocha": "^9.0.2", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^11.1.1", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", + "webpack": "^5.39.1", + "webpack-cli": "^4.7.2" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto b/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto new file mode 100644 index 00000000000..d3f9565f92d --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto @@ -0,0 +1,712 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.datafusion.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/iam/v1/policy.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.DataFusion.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1beta1;datafusion"; +option java_multiple_files = true; +option java_package = "com.google.cloud.datafusion.v1beta1"; +option php_namespace = "Google\\Cloud\\DataFusion\\V1beta1"; +option ruby_package = "Google::Cloud::DataFusion::V1beta1"; + +// Service for creating and managing Data Fusion instances. +// Data Fusion enables ETL developers to build code-free, data integration +// pipelines via a point-and-click UI. +service DataFusion { + option (google.api.default_host) = "datafusion.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists possible versions for Data Fusion instances in the specified project + // and location. + rpc ListAvailableVersions(ListAvailableVersionsRequest) + returns (ListAvailableVersionsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/versions" + }; + option (google.api.method_signature) = "parent"; + } + + // Lists Data Fusion instances in the specified project and location. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/instances" + }; + } + + // Gets details of a single Data Fusion instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + } + + // Creates a new Data Fusion instance in the specified project and location. + rpc CreateInstance(CreateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/instances" + body: "instance" + }; + option (google.api.method_signature) = "parent,instance,instance_id"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single Data Fusion instance. + rpc DeleteInstance(DeleteInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Updates a single Data Fusion instance. + rpc UpdateInstance(UpdateInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" + body: "instance" + }; + option (google.api.method_signature) = "instance,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Restart a single Data Fusion instance. + // At the end of an operation instance is fully restarted. + rpc RestartInstance(RestartInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restart" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Upgrade a single Data Fusion instance. + // At the end of an operation instance is fully upgraded. + rpc UpgradeInstance(UpgradeInstanceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "OperationMetadata" + }; + } + + // Remove IAM policy that is currently set on the given resource. + rpc RemoveIamPolicy(RemoveIamPolicyRequest) + returns (RemoveIamPolicyResponse) { + option (google.api.http) = { + post: "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy" + body: "*" + }; + } + + // List namespaces in a given instance + rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/namespaces" + }; + option (google.api.method_signature) = "parent"; + } + + // Add DNS peering on the given resource. + rpc AddDnsPeering(AddDnsPeeringRequest) returns (AddDnsPeeringResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:add" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // Remove DNS peering on the given resource. + rpc RemoveDnsPeering(RemoveDnsPeeringRequest) + returns (RemoveDnsPeeringResponse) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove" + body: "*" + }; + option (google.api.method_signature) = "parent"; + } + + // List DNS peering for a given resource. + rpc ListDnsPeerings(ListDnsPeeringsRequest) + returns (ListDnsPeeringsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Network configuration for a Data Fusion instance. These configurations +// are used for peering with the customer network. Configurations are optional +// when a public Data Fusion instance is to be created. However, providing +// these configurations allows several benefits, such as reduced network latency +// while accessing the customer resources from managed Data Fusion instance +// nodes, as well as access to the customer on-prem resources. +message NetworkConfig { + // Name of the network in the customer project with which the Tenant Project + // will be peered for executing pipelines. In case of shared VPC where the + // network resides in another host project the network should specified in + // the form of projects/{host-project-id}/global/networks/{network} + string network = 1; + + // The IP range in CIDR notation to use for the managed Data Fusion instance + // nodes. This range must not overlap with any other ranges used in the Data + // Fusion instance network. + string ip_allocation = 2; +} + +// The Data Fusion version. +message Version { + // The version number of the Data Fusion instance, such as '6.0.1.0'. + string version_number = 1; + + // Whether this is currently the default version for Cloud Data Fusion + bool default_version = 2; + + // Represents a list of available feature names for a given version. + repeated string available_features = 3; +} + +// Identifies Data Fusion accelerators for an instance. +message Accelerator { + // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion + // service. + enum AcceleratorType { + // Default value, if unspecified. + ACCELERATOR_TYPE_UNSPECIFIED = 0; + + // Change Data Capture accelerator for CDF. + CDC = 1; + + // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud + // Healthcare specific CDF plugins developed by Healthcare team. + HEALTHCARE = 2; + } + + // The type of an accelator for a CDF instance. + AcceleratorType accelerator_type = 1; +} + +// The crypto key configuration. This field is used by the Customer-managed +// encryption keys (CMEK) feature. +message CryptoKeyConfig { + // The name of the key which is used to encrypt/decrypt customer data. For key + // in Cloud KMS, the key should be in the format of + // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + string key_reference = 1; +} + +// Represents a Data Fusion instance. +message Instance { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // Represents the type of Data Fusion instance. Each type is configured with + // the default settings for processing and memory. + enum Type { + // No type specified. The instance creation will fail. + TYPE_UNSPECIFIED = 0; + + // Basic Data Fusion instance. In Basic type, the user will be able to + // create data pipelines using point and click UI. However, there are + // certain limitations, such as fewer number of concurrent pipelines, no + // support for streaming pipelines, etc. + BASIC = 1; + + // Enterprise Data Fusion instance. In Enterprise type, the user will have + // all features available, such as support for streaming pipelines, + // unlimited number of concurrent pipelines, etc. + ENTERPRISE = 2; + + // Developer Data Fusion instance. In Developer type, the user will have all + // features available but with restrictive capabilities. This is to help + // enterprises design and develop their data ingestion and integration + // pipelines at low cost. + DEVELOPER = 3; + } + + // Represents the state of a Data Fusion instance + enum State { + // Instance does not have a state yet + STATE_UNSPECIFIED = 0; + + // Instance is being created + CREATING = 1; + + // Instance is running and ready for requests + RUNNING = 2; + + // Instance creation failed + FAILED = 3; + + // Instance is being deleted + DELETING = 4; + + // Instance is being upgraded + UPGRADING = 5; + + // Instance is being restarted + RESTARTING = 6; + + // Instance is being updated on customer request + UPDATING = 7; + + // Instance is being auto-updated + AUTO_UPDATING = 8; + + // Instance is being auto-upgraded + AUTO_UPGRADING = 9; + } + + // Output only. The name of this instance is in the form of + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of this instance. + string description = 2; + + // Required. Instance type. + Type type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Option to enable Stackdriver Logging. + bool enable_stackdriver_logging = 4; + + // Option to enable Stackdriver Monitoring. + bool enable_stackdriver_monitoring = 5; + + // Specifies whether the Data Fusion instance should be private. If set to + // true, all Data Fusion nodes will have private IP addresses and will not be + // able to access the public internet. + bool private_instance = 6; + + // Network configuration options. These are required when a private Data + // Fusion instance is to be created. + NetworkConfig network_config = 7; + + // The resource labels for instance to use to annotate any related underlying + // resources such as Compute Engine VMs. The character '=' is not allowed to + // be used within the labels. + map labels = 8; + + // Map of additional options used to configure the behavior of + // Data Fusion instance. + map options = 9; + + // Output only. The time the instance was created. + google.protobuf.Timestamp create_time = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the instance was last updated. + google.protobuf.Timestamp update_time = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of this Data Fusion instance. + State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the current state of this Data + // Fusion instance if available. + string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Endpoint on which the Data Fusion UI is accessible. + string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Name of the zone in which the Data Fusion instance will be created. Only + // DEVELOPER instances use this field. + string zone = 15; + + // Current version of Data Fusion. + string version = 16; + + // Output only. Deprecated. Use tenant_project_id instead to extract the + // tenant project ID. + string service_account = 17 + [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + + // Display name for an instance. + string display_name = 18; + + // Available versions that the instance can be upgraded to using + // UpdateInstanceRequest. + repeated Version available_version = 19; + + // Output only. Endpoint on which the REST APIs is accessible. + string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud Storage bucket generated by Data Fusion in the customer + // project. + string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // List of accelerators enabled for this CDF instance. + repeated Accelerator accelerators = 22; + + // Output only. P4 service account for the customer project. + string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The name of the tenant project. + string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // User-managed service account to set on Dataproc when Cloud Data Fusion + // creates Dataproc to run data processing pipelines. + // + // This allows users to have fine-grained access control on Dataproc's + // accesses to cloud resources. + string dataproc_service_account = 25; + + // Option to enable granular role-based access control. + bool enable_rbac = 26; + + // The crypto key configuration. This field is used by the Customer-Managed + // Encryption Keys (CMEK) feature. + CryptoKeyConfig crypto_key_config = 27; +} + +// Request message for listing Data Fusion instances. +message ListInstancesRequest { + // The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. If the location is + // specified as '-' (wildcard), then all regions available to the project + // are queried, and the results are aggregated. + string parent = 1; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // List filter. + string filter = 4; + + // Sort results. Supported values are "name", "name desc", or "" (unsorted). + string order_by = 5; +} + +// Response message for the list instance request. +message ListInstancesResponse { + // Represents a list of Data Fusion instances. + repeated Instance instances = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for the list available versions request. +message ListAvailableVersionsRequest { + // Required. The project and location for which to retrieve instance + // information in the format projects/{project}/locations/{location}. + string parent = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Whether or not to return the latest patch of every available minor version. + // If true, only the latest patch will be returned. Ex. if allowed versions is + // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + bool latest_patch_only = 4; +} + +// Response message for the list available versions request. +message ListAvailableVersionsResponse { + // Represents a list of versions that are supported. + repeated Version available_versions = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// Request message for getting details about a Data Fusion instance. +message GetInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1; +} + +// Request message for creating a Data Fusion instance. +message CreateInstanceRequest { + // The instance's project and location in the format + // projects/{project}/locations/{location}. + string parent = 1; + + // The name of the instance to create. + string instance_id = 2; + + // An instance resource. + Instance instance = 3; +} + +// Request message for deleting a Data Fusion instance. +message DeleteInstanceRequest { + // The instance resource name in the format + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Request message for updating a Data Fusion instance. +// Data Fusion only allows updating the labels, options, and stack driver +// settings. +message UpdateInstanceRequest { + // The instance resource that replaces the resource on the server. Currently, + // Data Fusion only allows replacing labels, options, and stack driver + // settings. All other fields will be ignored. + Instance instance = 1; + + // Field mask is used to specify the fields that the update will overwrite + // in an instance resource. 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, all the supported fields (labels and + // options currently) will be overwritten. + google.protobuf.FieldMask update_mask = 2; +} + +// Request message for restarting a Data Fusion instance. +message RestartInstanceRequest { + // Name of the Data Fusion instance which need to be restarted in the form of + // projects/{project}/locations/{location}/instances/{instance} + string name = 1; +} + +// Request message for upgrading a Data Fusion instance. +// To change the instance properties, instance update should be used. +message UpgradeInstanceRequest { + // Name of the Data Fusion instance which need to be upgraded in the form of + // projects/{project}/locations/{location}/instances/{instance} + // Instance will be upgraded with the latest stable version of the Data + // Fusion. + string name = 1; +} + +// Represents the metadata of a long-running operation. +message OperationMetadata { + // The time the operation was created. + google.protobuf.Timestamp create_time = 1; + + // The time the operation finished running. + google.protobuf.Timestamp end_time = 2; + + // Server-defined resource path for the target of the operation. + string target = 3; + + // Name of the verb executed by the operation. + string verb = 4; + + // Human-readable status of the operation if any. + string status_detail = 5; + + // Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a + // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to + // `Code.CANCELLED`. + bool requested_cancellation = 6; + + // API version used to start the operation. + string api_version = 7; +} + +// Request message for RemoveIamPolicy method. +message RemoveIamPolicyRequest { + // The resource on which IAM policy to be removed is attached to. + string resource = 1; +} + +// Response message for RemoveIamPolicy method. +message RemoveIamPolicyResponse {} + +// List namespaces request. +message ListNamespacesRequest { + // Required. The instance to list its namespaces. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // By default, only basic information about a namespace is returned + // (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + // information associated with a namespace gets returned + // (e.g. IAM policy set on the namespace) + NamespaceView view = 4; +} + +// IAMPolicy encapsulates the IAM policy name, definition and status of +// policy fetching. +message IAMPolicy { + // Policy definition if IAM policy fetching is successful, + // otherwise empty. + google.iam.v1.Policy policy = 1; + + // Status of iam policy fetching. + google.rpc.Status status = 2; +} + +// Represents the information of a namespace +message Namespace { + option (google.api.resource) = { + type: "datafusion.googleapis.com/Namespace" + pattern: "projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}" + }; + + // Name of the given namespace. + string name = 1; + + // IAM policy associated with this namespace. + IAMPolicy iam_policy = 2; +} + +// List namespaces response. +message ListNamespacesResponse { + // List of namespaces + repeated Namespace namespaces = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} + +// DNS peering configuration. These configurations are used to create +// DNS peering with the customer Cloud DNS. +message DnsPeering { + // Required. Name of the zone. + string zone = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Name of the dns. + string domain = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Optional description of the dns zone. + string description = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional target project to which dns peering should happen. + string target_project = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Optional target network to which dns peering should happen. + string target_network = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message to create dns peering. +message AddDnsPeeringRequest { + // The resource on which DNS peering will be created. + string parent = 1; + + // Dns peering config. + DnsPeering dns_peering = 2; +} + +// Response message for set dns peering method. +message AddDnsPeeringResponse {} + +// A view for Namespace +enum NamespaceView { + // Default/unset value, which will use BASIC view. + NAMESPACE_VIEW_UNSPECIFIED = 0; + + // Show the most basic metadata of a namespace + NAMESPACE_VIEW_BASIC = 1; + + // Returns all metadata of a namespace + NAMESPACE_VIEW_FULL = 2; +} + +// Request message to remove dns peering. +message RemoveDnsPeeringRequest { + // The resource on which DNS peering will be removed. + string parent = 1; + + // Required. The zone to be removed. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Response message for set dns peering method. +message RemoveDnsPeeringResponse {} + +// List dns peering request. +message ListDnsPeeringsRequest { + // Required. The resource on which dns peering will be listed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; + + // The maximum number of items to return. + int32 page_size = 2; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; +} + +// List dns peering response. +message ListDnsPeeringsResponse { + // List of dns peering configs. + repeated DnsPeering dns_peerings = 1; + + // Token to retrieve the next page of results or empty if there are no more + // results in the list. + string next_page_token = 2; +} diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js new file mode 100644 index 00000000000..81fb01a370a --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which DNS peering will be created. + */ + // const parent = 'abc123' + /** + * Dns peering config. + */ + // const dnsPeering = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function addDnsPeering() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.addDnsPeering(request); + console.log(response); + } + + addDnsPeering(); + // [END datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js new file mode 100644 index 00000000000..1f88908871d --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js @@ -0,0 +1,62 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance's project and location in the format + * projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The name of the instance to create. + */ + // const instanceId = 'abc123' + /** + * An instance resource. + */ + // const instance = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function createInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END datafusion_v1beta1_generated_DataFusion_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js new file mode 100644 index 00000000000..e03cda45f63 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function deleteInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js new file mode 100644 index 00000000000..c1719b4ac00 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js @@ -0,0 +1,53 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function getInstance() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END datafusion_v1beta1_generated_DataFusion_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js new file mode 100644 index 00000000000..2c7920b4aef --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + */ + // const latestPatchOnly = true + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listAvailableVersions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listAvailableVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listAvailableVersions(); + // [END datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js new file mode 100644 index 00000000000..1fbf286ba83 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource on which dns peering will be listed. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listDnsPeerings() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listDnsPeeringsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listDnsPeerings(); + // [END datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js new file mode 100644 index 00000000000..7ead3148fbc --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js @@ -0,0 +1,74 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_ListInstances_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + /** + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + */ + // const orderBy = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listInstances() { + // Construct request + const request = { + }; + + // Run request + const iterable = await datafusionClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END datafusion_v1beta1_generated_DataFusion_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js new file mode 100644 index 00000000000..f93b9a5622a --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -0,0 +1,71 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(parent) { + // [START datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance to list its namespaces. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + */ + // const view = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function listNamespaces() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await datafusionClient.listNamespacesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listNamespaces(); + // [END datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js new file mode 100644 index 00000000000..1fb6a727dca --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -0,0 +1,57 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main(zone) { + // [START datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which DNS peering will be removed. + */ + // const parent = 'abc123' + /** + * Required. The zone to be removed. + */ + // const zone = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function removeDnsPeering() { + // Construct request + const request = { + zone, + }; + + // Run request + const response = await datafusionClient.removeDnsPeering(request); + console.log(response); + } + + removeDnsPeering(); + // [END datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js new file mode 100644 index 00000000000..ed5f2043bf4 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -0,0 +1,52 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The resource on which IAM policy to be removed is attached to. + */ + // const resource = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function removeIamPolicy() { + // Construct request + const request = { + }; + + // Run request + const response = await datafusionClient.removeIamPolicy(request); + console.log(response); + } + + removeIamPolicy(); + // [END datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js new file mode 100644 index 00000000000..61720548f38 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -0,0 +1,54 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_RestartInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function restartInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.restartInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restartInstance(); + // [END datafusion_v1beta1_generated_DataFusion_RestartInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js new file mode 100644 index 00000000000..d04f0db8b0e --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.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 +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + */ + // const instance = '' + /** + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + */ + // const updateMask = '' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function updateInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js new file mode 100644 index 00000000000..888f2e90b56 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -0,0 +1,56 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + +'use strict'; + +function main() { + // [START datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Name of the Data Fusion instance which need to be upgraded in the form of + * projects/{project}/locations/{location}/instances/{instance} + * Instance will be upgraded with the latest stable version of the Data + * Fusion. + */ + // const name = 'abc123' + + // Imports the Datafusion library + const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + + // Instantiates a client + const datafusionClient = new DataFusionClient(); + + async function upgradeInstance() { + // Construct request + const request = { + }; + + // Run request + const [operation] = await datafusionClient.upgradeInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + upgradeInstance(); + // [END datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/src/index.ts b/packages/google-cloud-datafusion/v1beta1/src/index.ts new file mode 100644 index 00000000000..00c3afc66c3 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const DataFusionClient = v1beta1.DataFusionClient; +type DataFusionClient = v1beta1.DataFusionClient; +export {v1beta1, DataFusionClient}; +export default {v1beta1, DataFusionClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts new file mode 100644 index 00000000000..ea8fc9ee7d2 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts @@ -0,0 +1,2054 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; + +import { Transform } from 'stream'; +import { RequestType } from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/data_fusion_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './data_fusion_client_config.json'; +import { operationsProtos } from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for creating and managing Data Fusion instances. + * Data Fusion enables ETL developers to build code-free, data integration + * pipelines via a point-and-click UI. + * @class + * @memberof v1beta1 + */ +export class DataFusionClient { + private _terminated = false; + private _opts: ClientOptions; + private _providedCustomServicePath: boolean; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + dataFusionStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DataFusionClient. + * + * @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/master/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} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DataFusionClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set useJWTAccessWithScope on the auth object. + this.auth.useJWTAccessWithScope = true; + + // Set defaultServicePath on the auth object. + this.auth.defaultServicePath = staticMembers.servicePath; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + namespacePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}' + ), + }; + + // 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 = { + listAvailableVersions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), + listInstances: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), + listNamespaces: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'namespaces'), + listDnsPeerings: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dnsPeerings') + }; + + 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. + + this.operationsClient = this._gaxModule.lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined + }).operationsClient(opts); + const createInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const restartInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const restartInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + const upgradeInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + const upgradeInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata)), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + restartInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restartInstanceResponse.decode.bind(restartInstanceResponse), + restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + upgradeInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + upgradeInstanceResponse.decode.bind(upgradeInstanceResponse), + upgradeInstanceMetadata.decode.bind(upgradeInstanceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.datafusion.v1beta1.DataFusion', 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 = gax.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.dataFusionStub) { + return this.dataFusionStub; + } + + // Put together the "service stub" for + // google.cloud.datafusion.v1beta1.DataFusion. + this.dataFusionStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1beta1.DataFusion') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.datafusion.v1beta1.DataFusion, + 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 dataFusionStubMethods = + ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance', 'upgradeInstance', 'removeIamPolicy', 'listNamespaces', 'addDnsPeering', 'removeDnsPeering', 'listDnsPeerings']; + for (const methodName of dataFusionStubMethods) { + const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; + } + + return this.dataFusionStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'datafusion.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 'datafusion.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 -- + // ------------------- + getInstance( + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|undefined, {}|undefined + ]>; + getInstance( + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; + getInstance( + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): void; +/** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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.getInstance(request); + */ + getInstance( + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getInstance(request, options, callback); + } + removeIamPolicy( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|undefined, {}|undefined + ]>; + removeIamPolicy( + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): void; + removeIamPolicy( + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): void; +/** + * Remove IAM policy that is currently set on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * The resource on which IAM policy to be removed is attached to. + * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. + * 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.removeIamPolicy(request); + */ + removeIamPolicy( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|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' + ] = gax.routingHeader.fromParams({ + 'resource': request.resource || '', + }); + this.initialize(); + return this.innerApiCalls.removeIamPolicy(request, options, callback); + } + addDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|undefined, {}|undefined + ]>; + addDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; + addDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; +/** + * Add DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be created. + * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering + * Dns peering config. + * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. + * 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.addDnsPeering(request); + */ + addDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.addDnsPeering(request, options, callback); + } + removeDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|undefined, {}|undefined + ]>; + removeDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; + removeDnsPeering( + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): void; +/** + * Remove DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be removed. + * @param {string} request.zone + * Required. The zone to be removed. + * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. + * 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.removeDnsPeering(request); + */ + removeDnsPeering( + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.removeDnsPeering(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createInstance( + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createInstance( + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ + createInstance( + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + deleteInstance( + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteInstance( + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteInstance( + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Deletes a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + updateInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ + updateInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + restartInstance( + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restartInstance( + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restartInstance( + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ + restartInstance( + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restartInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + upgradeInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; +/** + * Upgrade a single Data Fusion instance. + * At the end of an operation instance is fully upgraded. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be upgraded in the form of + * projects/{project}/locations/{location}/instances/{instance} + * Instance will be upgraded with the latest stable version of the Data + * Fusion. + * @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 + * const [operation] = await client.upgradeInstance(request); + * const [response] = await operation.promise(); + */ + upgradeInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + optionsOrCallback?: CallOptions|Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>, + callback?: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): + Promise<[ + LROperation, + 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' + ] = gax.routingHeader.fromParams({ + 'name': request.name || '', + }); + this.initialize(); + return this.innerApiCalls.upgradeInstance(request, options, callback); + } +/** + * Check the status of the long running operation returned by `upgradeInstance()`. + * @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 + * const decodedOperation = await checkUpgradeInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpgradeInstanceProgress(name: string): Promise>{ + const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.upgradeInstance, gax.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ]>; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): void; +/** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IVersion>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ + listAvailableVersionsStream( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.createStream( + this.innerApiCalls.listAvailableVersions as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1beta1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAvailableVersionsAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listAvailableVersions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listAvailableVersions.asyncIterate( + this.innerApiCalls['listAvailableVersions'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listInstances( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ]>; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): void; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): void; +/** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ + listInstances( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IInstance>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listInstances(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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance} 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 `listInstancesAsync()` + * 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. + */ + listInstancesStream( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.createStream( + this.innerApiCalls.listInstances as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listInstancesAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listNamespaces( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ]>; + listNamespaces( + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): void; + listNamespaces( + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): void; +/** + * List namespaces in a given instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. + * 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 `listNamespacesAsync()` + * 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. + */ + listNamespaces( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.INamespace>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listNamespaces(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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace} 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 `listNamespacesAsync()` + * 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. + */ + listNamespacesStream( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listNamespaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNamespaces.createStream( + this.innerApiCalls.listNamespaces as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listNamespaces`, 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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 + * [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. 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.listNamespacesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listNamespacesAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listNamespaces']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listNamespaces.asyncIterate( + this.innerApiCalls['listNamespaces'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listDnsPeerings( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ]>; + listDnsPeerings( + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; + listDnsPeerings( + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; +/** + * List DNS peering for a given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. + * 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 `listDnsPeeringsAsync()` + * 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. + */ + listDnsPeerings( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering>): + Promise<[ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ]>|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' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDnsPeerings(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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering} 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 `listDnsPeeringsAsync()` + * 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. + */ + listDnsPeeringsStream( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + Transform{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + const defaultCallSettings = this._defaults['listDnsPeerings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsPeerings.createStream( + this.innerApiCalls.listDnsPeerings as gax.GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDnsPeerings`, 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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 + * [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. 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.listDnsPeeringsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listDnsPeeringsAsync( + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions): + AsyncIterable{ + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'parent': request.parent || '', + }); + options = options || {}; + const defaultCallSettings = this._defaults['listDnsPeerings']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listDnsPeerings.asyncIterate( + this.innerApiCalls['listDnsPeerings'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified instance resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @returns {string} Resource name string. + */ + instancePath(project:string,location:string,instance:string) { + return this.pathTemplates.instancePathTemplate.render({ + project: project, + location: location, + instance: instance, + }); + } + + /** + * Parse the project from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the project. + */ + matchProjectFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).project; + } + + /** + * Parse the location from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the location. + */ + matchLocationFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).location; + } + + /** + * Parse the instance from Instance resource. + * + * @param {string} instanceName + * A fully-qualified path representing Instance resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromInstanceName(instanceName: string) { + return this.pathTemplates.instancePathTemplate.match(instanceName).instance; + } + + /** + * Return a fully-qualified namespace resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} namespace + * @returns {string} Resource name string. + */ + namespacePath(project:string,location:string,instance:string,namespace:string) { + return this.pathTemplates.namespacePathTemplate.render({ + project: project, + location: location, + instance: instance, + namespace: namespace, + }); + } + + /** + * Parse the project from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the project. + */ + matchProjectFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).project; + } + + /** + * Parse the location from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the location. + */ + matchLocationFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).location; + } + + /** + * Parse the instance from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).instance; + } + + /** + * Parse the namespace from Namespace resource. + * + * @param {string} namespaceName + * A fully-qualified path representing Namespace resource. + * @returns {string} A string representing the namespace. + */ + matchNamespaceFromNamespaceName(namespaceName: string) { + return this.pathTemplates.namespacePathTemplate.match(namespaceName).namespace; + } + + /** + * 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 { + this.initialize(); + if (!this._terminated) { + return this.dataFusionStub!.then(stub => { + this._terminated = true; + stub.close(); + this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json new file mode 100644 index 00000000000..fb09a3c732a --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json @@ -0,0 +1,91 @@ +{ + "interfaces": { + "google.cloud.datafusion.v1beta1.DataFusion": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAvailableVersions": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestartInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpgradeInstance": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveIamPolicy": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListNamespaces": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "AddDnsPeering": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RemoveDnsPeering": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDnsPeerings": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json new file mode 100644 index 00000000000..ea2e94605fb --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/datafusion/v1beta1/v1beta1.proto" +] diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..24ee6be68aa --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,169 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.datafusion.v1beta1", + "libraryPackage": "@google-cloud/datafusion", + "services": { + "DataFusion": { + "clients": { + "grpc": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "RemoveIamPolicy": { + "methods": [ + "removeIamPolicy" + ] + }, + "AddDnsPeering": { + "methods": [ + "addDnsPeering" + ] + }, + "RemoveDnsPeering": { + "methods": [ + "removeDnsPeering" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgradeInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListNamespaces": { + "methods": [ + "listNamespaces", + "listNamespacesStream", + "listNamespacesAsync" + ] + }, + "ListDnsPeerings": { + "methods": [ + "listDnsPeerings", + "listDnsPeeringsStream", + "listDnsPeeringsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DataFusionClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "RemoveIamPolicy": { + "methods": [ + "removeIamPolicy" + ] + }, + "AddDnsPeering": { + "methods": [ + "addDnsPeering" + ] + }, + "RemoveDnsPeering": { + "methods": [ + "removeDnsPeering" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestartInstance": { + "methods": [ + "restartInstance" + ] + }, + "UpgradeInstance": { + "methods": [ + "upgradeInstance" + ] + }, + "ListAvailableVersions": { + "methods": [ + "listAvailableVersions", + "listAvailableVersionsStream", + "listAvailableVersionsAsync" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListNamespaces": { + "methods": [ + "listNamespaces", + "listNamespacesStream", + "listNamespacesAsync" + ] + }, + "ListDnsPeerings": { + "methods": [ + "listDnsPeerings", + "listDnsPeeringsStream", + "listDnsPeeringsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000000..6dd78dbfb06 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..1efd2377537 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const datafusion = require('@google-cloud/datafusion'); + +function main() { + const dataFusionClient = new datafusion.DataFusionClient(); +} + +main(); diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..39d8d911158 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {DataFusionClient} from '@google-cloud/datafusion'; + +// check that the client class type name can be used +function doStuffWithDataFusionClient(client: DataFusionClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const dataFusionClient = new DataFusionClient(); + doStuffWithDataFusionClient(dataFusionClient); +} + +main(); diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/install.ts b/packages/google-cloud-datafusion/v1beta1/system-test/install.ts new file mode 100644 index 00000000000..1f850b522f3 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts new file mode 100644 index 00000000000..db993ba4c82 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts @@ -0,0 +1,2238 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +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 datafusionModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +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('v1beta1.DataFusionClient', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1beta1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1beta1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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 datafusionModule.v1beta1.DataFusionClient({ + 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('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); + client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getInstance(request), expectedError); + assert((client.innerApiCalls.getInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('removeIamPolicy', () => { + it('invokes removeIamPolicy without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); + client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.removeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeIamPolicy without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); + client.innerApiCalls.removeIamPolicy = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeIamPolicy( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeIamPolicy with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); + request.resource = ''; + const expectedHeaderRequestParams = "resource="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeIamPolicy = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeIamPolicy(request), expectedError); + assert((client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('addDnsPeering', () => { + it('invokes addDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); + client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.addDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes addDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); + client.innerApiCalls.addDnsPeering = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addDnsPeering( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes addDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addDnsPeering = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.addDnsPeering(request), expectedError); + assert((client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('removeDnsPeering', () => { + it('invokes removeDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); + client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.removeDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes removeDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); + client.innerApiCalls.removeDnsPeering = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDnsPeering( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes removeDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDnsPeering = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.removeDnsPeering(request), expectedError); + assert((client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createInstance(request), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.createInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateInstance(request), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = "instance.name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.updateInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restartInstance(request), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.restartInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('upgradeInstance', () => { + it('invokes upgradeInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes upgradeInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); + client.innerApiCalls.upgradeInstance = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeInstance( + request, + (err?: Error|null, + result?: LROperation|null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const operation = await promise as LROperation; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes upgradeInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.upgradeInstance(request), expectedError); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes upgradeInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); + request.name = ''; + const expectedHeaderRequestParams = "name="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.upgradeInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert((client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes checkUpgradeInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpgradeInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IVersion[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listAvailableVersions(request), expectedError); + assert((client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { + 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.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listInstances(request), expectedError); + assert((client.innerApiCalls.listInstances as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); + assert.strictEqual( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNamespaces', () => { + it('invokes listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); + const [response] = await client.listNamespaces(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listNamespaces without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.innerApiCalls.listNamespaces = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNamespaces( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.INamespace[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNamespaces = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listNamespaces(request), expectedError); + assert((client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listNamespacesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + 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.listNamespaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); + assert.strictEqual( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listNamespacesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); + assert.strictEqual( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), + ]; + client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; + const iterable = client.listNamespacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNamespacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDnsPeerings', () => { + it('invokes listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); + const [response] = await client.listDnsPeerings(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDnsPeerings without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.innerApiCalls.listDnsPeerings = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDnsPeerings( + request, + (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IDnsPeering[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDnsPeerings = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDnsPeerings(request), expectedError); + assert((client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listDnsPeeringsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + 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.listDnsPeerings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listDnsPeeringsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; + stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent="; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), + ]; + client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; + const iterable = client.listDnsPeeringsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); + request.parent = ''; + const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDnsPeeringsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert.strictEqual( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + + describe('instance', () => { + const fakePath = "/rendered/path/instance"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.instancePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath("projectValue", "locationValue", "instanceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('namespace', () => { + const fakePath = "/rendered/path/namespace"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + instance: "instanceValue", + namespace: "namespaceValue", + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.namespacePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.namespacePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('namespacePath', () => { + const result = client.namespacePath("projectValue", "locationValue", "instanceValue", "namespaceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.namespacePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromNamespaceName', () => { + const result = client.matchProjectFromNamespaceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromNamespaceName', () => { + const result = client.matchLocationFromNamespaceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchInstanceFromNamespaceName', () => { + const result = client.matchInstanceFromNamespaceName(fakePath); + assert.strictEqual(result, "instanceValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchNamespaceFromNamespaceName', () => { + const result = client.matchNamespaceFromNamespaceName(fakePath); + assert.strictEqual(result, "namespaceValue"); + assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/packages/google-cloud-datafusion/v1beta1/tsconfig.json b/packages/google-cloud-datafusion/v1beta1/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/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-datafusion/v1beta1/webpack.config.js b/packages/google-cloud-datafusion/v1beta1/webpack.config.js new file mode 100644 index 00000000000..7346a1e4405 --- /dev/null +++ b/packages/google-cloud-datafusion/v1beta1/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: 'DataFusion', + filename: './data-fusion.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/packages/google-cloud-datafusion/webpack.config.js b/packages/google-cloud-datafusion/webpack.config.js new file mode 100644 index 00000000000..7346a1e4405 --- /dev/null +++ b/packages/google-cloud-datafusion/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: 'DataFusion', + filename: './data-fusion.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', +}; From 9228561ae4b005a30e8c71cfcbb241588022f26c Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 7 Oct 2021 11:54:34 -0700 Subject: [PATCH 03/47] feat: add tests and samples to library (#1) * feat: add tests and samples to library See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-datafusion/.jsdoc.js | 2 +- packages/google-cloud-datafusion/README.md | 8 +- .../linkinator.config.json | 13 +- packages/google-cloud-datafusion/package.json | 67 +- .../v1/data_fusion.create_instance.js | 6 +- .../v1/data_fusion.delete_instance.js | 6 +- .../generated/v1/data_fusion.get_instance.js | 6 +- .../v1/data_fusion.list_available_versions.js | 5 +- .../v1/data_fusion.list_instances.js | 8 +- .../v1/data_fusion.restart_instance.js | 6 +- .../v1/data_fusion.update_instance.js | 6 +- .../v1beta1/data_fusion.add_dns_peering.js | 6 +- .../v1beta1/data_fusion.create_instance.js | 6 +- .../v1beta1/data_fusion.delete_instance.js | 6 +- .../v1beta1/data_fusion.get_instance.js | 6 +- .../data_fusion.list_available_versions.js | 5 +- .../v1beta1/data_fusion.list_dns_peerings.js | 5 +- .../v1beta1/data_fusion.list_instances.js | 8 +- .../v1beta1/data_fusion.list_namespaces.js | 5 +- .../v1beta1/data_fusion.remove_dns_peering.js | 3 +- .../v1beta1/data_fusion.remove_iam_policy.js | 6 +- .../v1beta1/data_fusion.restart_instance.js | 6 +- .../v1beta1/data_fusion.update_instance.js | 6 +- .../v1beta1/data_fusion.upgrade_instance.js | 6 +- .../samples/quickstart.js | 69 +- .../samples/test/quickstart.js | 13 +- .../src/v1/data_fusion_client.ts | 1735 +++--- .../src/v1/gapic_metadata.json | 2 +- .../src/v1beta1/data_fusion_client.ts | 2979 +++++----- .../src/v1beta1/gapic_metadata.json | 2 +- .../system-test/fixtures/sample/src/index.js | 3 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 24 +- .../test/gapic_data_fusion_v1.ts | 2902 ++++++---- .../test/gapic_data_fusion_v1beta1.ts | 5003 ++++++++++------- .../google-cloud-datafusion/v1/.eslintignore | 7 - .../google-cloud-datafusion/v1/.eslintrc.json | 3 - .../google-cloud-datafusion/v1/.gitignore | 14 - packages/google-cloud-datafusion/v1/.jsdoc.js | 55 - .../google-cloud-datafusion/v1/.mocharc.js | 33 - .../google-cloud-datafusion/v1/.prettierrc.js | 22 - packages/google-cloud-datafusion/v1/README.md | 1 - .../v1/linkinator.config.json | 10 - .../google-cloud-datafusion/v1/package.json | 64 - .../cloud/datafusion/v1/datafusion.proto | 519 -- .../v1/data_fusion.create_instance.js | 62 - .../v1/data_fusion.delete_instance.js | 54 - .../generated/v1/data_fusion.get_instance.js | 53 - .../v1/data_fusion.list_available_versions.js | 71 - .../v1/data_fusion.list_instances.js | 74 - .../v1/data_fusion.restart_instance.js | 54 - .../v1/data_fusion.update_instance.js | 64 - .../google-cloud-datafusion/v1/src/index.ts | 25 - .../v1/src/v1/data_fusion_client.ts | 1286 ----- .../v1/src/v1/data_fusion_client_config.json | 61 - .../v1/src/v1/data_fusion_proto_list.json | 3 - .../v1/src/v1/gapic_metadata.json | 101 - .../v1/src/v1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1/system-test/install.ts | 49 - .../v1/test/gapic_data_fusion_v1.ts | 1342 ----- .../google-cloud-datafusion/v1/tsconfig.json | 19 - .../v1/webpack.config.js | 64 - .../v1beta1/.eslintignore | 7 - .../v1beta1/.eslintrc.json | 3 - .../v1beta1/.gitignore | 14 - .../google-cloud-datafusion/v1beta1/.jsdoc.js | 55 - .../v1beta1/.mocharc.js | 33 - .../v1beta1/.prettierrc.js | 22 - .../google-cloud-datafusion/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 10 - .../v1beta1/package.json | 64 - .../cloud/datafusion/v1beta1/v1beta1.proto | 712 --- .../v1beta1/data_fusion.add_dns_peering.js | 56 - .../v1beta1/data_fusion.create_instance.js | 62 - .../v1beta1/data_fusion.delete_instance.js | 54 - .../v1beta1/data_fusion.get_instance.js | 53 - .../data_fusion.list_available_versions.js | 71 - .../v1beta1/data_fusion.list_dns_peerings.js | 64 - .../v1beta1/data_fusion.list_instances.js | 74 - .../v1beta1/data_fusion.list_namespaces.js | 71 - .../v1beta1/data_fusion.remove_dns_peering.js | 57 - .../v1beta1/data_fusion.remove_iam_policy.js | 52 - .../v1beta1/data_fusion.restart_instance.js | 54 - .../v1beta1/data_fusion.update_instance.js | 64 - .../v1beta1/data_fusion.upgrade_instance.js | 56 - .../v1beta1/src/index.ts | 25 - .../v1beta1/src/v1beta1/data_fusion_client.ts | 2054 ------- .../v1beta1/data_fusion_client_config.json | 91 - .../src/v1beta1/data_fusion_proto_list.json | 3 - .../v1beta1/src/v1beta1/gapic_metadata.json | 169 - .../v1beta1/src/v1beta1/index.ts | 19 - .../system-test/fixtures/sample/src/index.js | 27 - .../system-test/fixtures/sample/src/index.ts | 32 - .../v1beta1/system-test/install.ts | 49 - .../v1beta1/test/gapic_data_fusion_v1beta1.ts | 2238 -------- .../v1beta1/tsconfig.json | 19 - .../v1beta1/webpack.config.js | 64 - .../google-cloud-datafusion/webpack.config.js | 12 +- 100 files changed, 7476 insertions(+), 16164 deletions(-) delete mode 100644 packages/google-cloud-datafusion/v1/.eslintignore delete mode 100644 packages/google-cloud-datafusion/v1/.eslintrc.json delete mode 100644 packages/google-cloud-datafusion/v1/.gitignore delete mode 100644 packages/google-cloud-datafusion/v1/.jsdoc.js delete mode 100644 packages/google-cloud-datafusion/v1/.mocharc.js delete mode 100644 packages/google-cloud-datafusion/v1/.prettierrc.js delete mode 100644 packages/google-cloud-datafusion/v1/README.md delete mode 100644 packages/google-cloud-datafusion/v1/linkinator.config.json delete mode 100644 packages/google-cloud-datafusion/v1/package.json delete mode 100644 packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js delete mode 100644 packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js delete mode 100644 packages/google-cloud-datafusion/v1/src/index.ts delete mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts delete mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json delete mode 100644 packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json delete mode 100644 packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json delete mode 100644 packages/google-cloud-datafusion/v1/src/v1/index.ts delete mode 100644 packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js delete mode 100644 packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 packages/google-cloud-datafusion/v1/system-test/install.ts delete mode 100644 packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts delete mode 100644 packages/google-cloud-datafusion/v1/tsconfig.json delete mode 100644 packages/google-cloud-datafusion/v1/webpack.config.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/.eslintignore delete mode 100644 packages/google-cloud-datafusion/v1beta1/.eslintrc.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/.gitignore delete mode 100644 packages/google-cloud-datafusion/v1beta1/.jsdoc.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/.mocharc.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/.prettierrc.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/README.md delete mode 100644 packages/google-cloud-datafusion/v1beta1/linkinator.config.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/package.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/index.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/system-test/install.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts delete mode 100644 packages/google-cloud-datafusion/v1beta1/tsconfig.json delete mode 100644 packages/google-cloud-datafusion/v1beta1/webpack.config.js diff --git a/packages/google-cloud-datafusion/.jsdoc.js b/packages/google-cloud-datafusion/.jsdoc.js index 37689bedd59..edfc037518e 100644 --- a/packages/google-cloud-datafusion/.jsdoc.js +++ b/packages/google-cloud-datafusion/.jsdoc.js @@ -43,7 +43,7 @@ module.exports = { copyright: 'Copyright 2021 Google LLC', includeDate: false, sourceFiles: false, - systemName: '@google-cloud/datafusion', + systemName: '@google-cloud/data-fusion', theme: 'lumen', default: { outputSourceFiles: false diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index eb9335cf4ad..0ff1c0f07fc 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -6,7 +6,7 @@ [![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/data-fusion.svg)](https://www.npmjs.org/package/@google-cloud/data-fusion) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-fusion/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-fusion) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-fusion/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-fusion) @@ -15,7 +15,7 @@ datafusion client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-data-fusion/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-data-fusion/blob/main/CHANGELOG.md). * [Cloud Data Fusion Node.js Client API Reference][client-docs] * [Cloud Data Fusion Documentation][product-docs] @@ -102,7 +102,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-data-fusion/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-data-fusion/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`) @@ -114,7 +114,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-data-fusion/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-data-fusion/blob/main/LICENSE) [client-docs]: https://cloud.google.com/data-fusion [product-docs]: https://cloud.google.com/data-fusion/ diff --git a/packages/google-cloud-datafusion/linkinator.config.json b/packages/google-cloud-datafusion/linkinator.config.json index 0947c2e0e5b..bf52b718fc7 100644 --- a/packages/google-cloud-datafusion/linkinator.config.json +++ b/packages/google-cloud-datafusion/linkinator.config.json @@ -1 +1,12 @@ -{"recurse":true,"skip":["https://codecov.io/gh/googleapis/","www.googleapis.com","img.shields.io"],"silent":true,"concurrency":10} \ No newline at end of file +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io", + "https://www.npmjs.org/package/@google-cloud/data-fusion", + "https://github.com/googleapis/nodejs-data-fusion/blob/addSamplesAndTests/CHANGELOG.md" + ], + "silent": true, + "concurrency": 10 +} diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 433ba6956be..b4350dd2610 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1 +1,66 @@ -{"name":"@google-cloud/data-fusion","version":"0.1.0","description":"datafusion client for Node.js","repository":"googleapis/googleapis/nodejs-data-fusion","license":"Apache-2.0","author":"Google LLC","main":"build/src/index.js","files":["build/src","build/protos"],"keywords":["google apis client","google api client","google apis","google api","google","google cloud platform","google cloud","cloud","google datafusion","datafusion","datafusion service"],"scripts":{"clean":"gts clean","compile":"tsc -p . && cp -r protos build/","compile-protos":"compileProtos src","docs":"jsdoc -c .jsdoc.js","predocs-test":"npm run docs","docs-test":"linkinator docs","fix":"gts fix","lint":"gts check","prepare":"npm run compile-protos && npm run compile","system-test":"c8 mocha build/system-test","test":"c8 mocha build/test","samples-test":"cd samples/ && npm link ../ && npm test","prelint":"cd samples; npm link ../; npm i"},"dependencies":{"google-gax":"^2.12.0"},"devDependencies":{"@types/mocha":"^8.2.2","@types/node":"^14.14.44","@types/sinon":"^10.0.0","c8":"^7.7.2","gts":"^3.1.0","jsdoc":"^3.6.6","jsdoc-fresh":"^1.0.2","jsdoc-region-tag":"^1.0.6","linkinator":"^2.13.6","mocha":"^8.4.0","null-loader":"^4.0.1","pack-n-play":"^1.0.0-2","sinon":"^10.0.0","ts-loader":"^9.1.2","typescript":"^4.2.4","webpack":"^5.36.2","webpack-cli":"^4.7.0"},"engines":{"node":">=v10.0.0"}} \ No newline at end of file +{ + "name": "@google-cloud/data-fusion", + "version": "0.1.0", + "description": "datafusion client for Node.js", + "repository": "googleapis/nodejs-data-fusion", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google datafusion", + "datafusion", + "datafusion service" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test", + "samples-test": "cd samples/ && npm link ../ && npm test", + "prelint": "cd samples; npm link ../; npm i" + }, + "dependencies": { + "google-gax": "^2.12.0" + }, + "devDependencies": { + "@types/mocha": "^8.2.2", + "@types/node": "^14.14.44", + "@types/sinon": "^10.0.0", + "c8": "^7.7.2", + "gts": "^3.1.0", + "jsdoc": "^3.6.6", + "jsdoc-fresh": "^1.0.2", + "jsdoc-region-tag": "^1.0.6", + "linkinator": "^2.13.6", + "mocha": "^8.4.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^10.0.0", + "ts-loader": "^9.1.2", + "typescript": "^4.2.4", + "webpack": "^5.36.2", + "webpack-cli": "^4.7.0" + }, + "engines": { + "node": ">=v10.0.0" + } +} diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js index b09e4d001ec..febcb8ca704 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -35,15 +34,14 @@ function main() { // const instance = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function createInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.createInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js index cde15d47f32..ea460cdcfc8 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function deleteInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.deleteInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js index 1945250c1b5..11d044958b3 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function getInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const response = await datafusionClient.getInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js index 9d43499b31a..f4a049b30cc 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main(parent) { @@ -42,7 +41,7 @@ function main(parent) { // const latestPatchOnly = true // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); @@ -56,7 +55,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listAvailableVersionsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js index be588b26034..556953f8659 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -46,20 +45,19 @@ function main() { // const orderBy = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function listInstances() { // Construct request - const request = { - }; + const request = {}; // Run request const iterable = await datafusionClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js index a879d529a74..b8f4b51eac0 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function restartInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.restartInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js index f25496040e9..ea636f4ef59 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -37,15 +36,14 @@ function main() { // const updateMask = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function updateInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.updateInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js index 81fb01a370a..30371c53967 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -30,15 +29,14 @@ function main() { // const dnsPeering = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function addDnsPeering() { // Construct request - const request = { - }; + const request = {}; // Run request const response = await datafusionClient.addDnsPeering(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js index 1f88908871d..db9c0eb689b 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -35,15 +34,14 @@ function main() { // const instance = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function createInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.createInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js index e03cda45f63..06e53a7918b 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function deleteInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.deleteInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js index c1719b4ac00..08350e450b8 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function getInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const response = await datafusionClient.getInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js index 2c7920b4aef..2d9b3920049 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main(parent) { @@ -42,7 +41,7 @@ function main(parent) { // const latestPatchOnly = true // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); @@ -56,7 +55,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listAvailableVersionsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js index 1fbf286ba83..1f2c203b6ac 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main(parent) { @@ -35,7 +34,7 @@ function main(parent) { // const pageToken = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); @@ -49,7 +48,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listDnsPeeringsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js index 7ead3148fbc..589504907ea 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -46,20 +45,19 @@ function main() { // const orderBy = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function listInstances() { // Construct request - const request = { - }; + const request = {}; // Run request const iterable = await datafusionClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js index f93b9a5622a..dc5ec704b30 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main(parent) { @@ -42,7 +41,7 @@ function main(parent) { // const view = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); @@ -56,7 +55,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listNamespacesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js index 1fb6a727dca..874382f8956 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main(zone) { @@ -30,7 +29,7 @@ function main(zone) { // const zone = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js index ed5f2043bf4..dba3b7dfad7 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -26,15 +25,14 @@ function main() { // const resource = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function removeIamPolicy() { // Construct request - const request = { - }; + const request = {}; // Run request const response = await datafusionClient.removeIamPolicy(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js index 61720548f38..e8faf24c80e 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -27,15 +26,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function restartInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.restartInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js index d04f0db8b0e..529ffa9b8c3 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -37,15 +36,14 @@ function main() { // const updateMask = '' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function updateInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.updateInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js index 888f2e90b56..1b1175ef58d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. - 'use strict'; function main() { @@ -29,15 +28,14 @@ function main() { // const name = 'abc123' // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; + const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; // Instantiates a client const datafusionClient = new DataFusionClient(); async function upgradeInstance() { // Construct request - const request = { - }; + const request = {}; // Run request const [operation] = await datafusionClient.upgradeInstance(request); diff --git a/packages/google-cloud-datafusion/samples/quickstart.js b/packages/google-cloud-datafusion/samples/quickstart.js index ab3680fc9cf..4dfbdfbdc98 100644 --- a/packages/google-cloud-datafusion/samples/quickstart.js +++ b/packages/google-cloud-datafusion/samples/quickstart.js @@ -1,50 +1,71 @@ +// 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 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// 'use strict'; -async function main() { +function main(parent) { + // [START datafusion_v1_generated_DataFusion_ListAvailableVersions_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + */ + // const parent = 'abc123' + /** + * The maximum number of items to return. + */ + // const pageSize = 1234 + /** + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + */ + // const pageToken = 'abc123' + /** + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + */ + // const latestPatchOnly = true - // [START nodejs_data_fusion_quickstart] - // Imports the Google Cloud client library - - // remove this line after package is released + // Imports the Datafusion library // eslint-disable-next-line node/no-missing-require const {DataFusionClient} = require('@google-cloud/data-fusion'); - // TODO(developer): replace with your prefered project ID. - // const projectId = 'my-project' + // Instantiates a client + const datafusionClient = new DataFusionClient(); - // Creates a client - // eslint-disable-next-line no-unused-vars - const client = new {DataFusionClient}(); + async function listAvailableVersions() { + // Construct request + const request = { + parent, + }; - //TODO(library generator): write the actual function you will be testing - async function doSomething() { - console.log('DPE! Change this code so that it shows how to use the library! See comments below on structure.') - // const [thing] = await client.methodName({ - // }); - // console.info(thing); + // Run request + const iterable = await datafusionClient.listAvailableVersionsAsync(request); + for await (const response of iterable) { + console.log(response); + } } - doSomething(); - // [END nodejs_data_fusion_quickstart] + + listAvailableVersions(); + // [END datafusion_v1_generated_DataFusion_ListAvailableVersions_async] } -main(...process.argv.slice(2)).catch(err => { - console.error(err.message); - process.exitCode = 1; -}); process.on('unhandledRejection', err => { console.error(err.message); process.exitCode = 1; }); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/samples/test/quickstart.js b/packages/google-cloud-datafusion/samples/test/quickstart.js index 037c142f63e..4e2182169db 100644 --- a/packages/google-cloud-datafusion/samples/test/quickstart.js +++ b/packages/google-cloud-datafusion/samples/test/quickstart.js @@ -20,34 +20,27 @@ const path = require('path'); const cp = require('child_process'); const {before, describe, it} = require('mocha'); -// eslint-disable-next-line node/no-missing-require const {DataFusionClient} = require('@google-cloud/data-fusion'); -// eslint-disable-next-line no-unused-vars, node/no-missing-require const {assert} = require('chai'); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); -const client = new {DataFusionClient}(); +const client = new DataFusionClient(); describe('Quickstart', () => { - //TODO: remove this if not using the projectId - // eslint-disable-next-line no-unused-vars let projectId; before(async () => { - // eslint-disable-next-line no-unused-vars projectId = await client.getProjectId(); }); it('should run quickstart', async () => { - //TODO: remove this line - // eslint-disable-next-line no-unused-vars const stdout = execSync( - `node ./quickstart.js`, + `node ./quickstart.js projects/${projectId}/locations/us-central1`, {cwd} ); - //assert(stdout, stdout !== null); + assert.match(stdout, /availableFeatures/); }); }); diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index fe982d87cca..00bee584faf 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -18,10 +18,18 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -30,7 +38,7 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './data_fusion_client_config.json'; -import { operationsProtos } from 'google-gax'; +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -98,11 +106,16 @@ export class DataFusionClient { constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DataFusionClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + 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'); + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -120,7 +133,7 @@ export class DataFusionClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -134,10 +147,7 @@ export class DataFusionClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -145,7 +155,7 @@ export class DataFusionClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { + } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -167,10 +177,16 @@ export class DataFusionClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listAvailableVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances') + listAvailableVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'availableVersions' + ), + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -179,50 +195,67 @@ export class DataFusionClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.Instance' + ) as gax.protobuf.Type; const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.OperationMetadata' + ) as gax.protobuf.Type; const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; + '.google.protobuf.Empty' + ) as gax.protobuf.Type; const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.OperationMetadata' + ) as gax.protobuf.Type; const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.Instance' + ) as gax.protobuf.Type; const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.OperationMetadata' + ) as gax.protobuf.Type; const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.Instance' + ) as gax.protobuf.Type; const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), deleteInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), updateInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), restartInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)) + restartInstanceMetadata.decode.bind(restartInstanceMetadata) + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.datafusion.v1.DataFusion', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.datafusion.v1.DataFusion', + 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 @@ -253,28 +286,41 @@ export class DataFusionClient { // Put together the "service stub" for // google.cloud.datafusion.v1.DataFusion. this.dataFusionStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1.DataFusion') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.datafusion.v1.DataFusion' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.datafusion.v1.DataFusion, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 dataFusionStubMethods = - ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance']; + const dataFusionStubMethods = [ + 'listAvailableVersions', + 'listInstances', + 'getInstance', + 'createInstance', + 'deleteInstance', + 'updateInstance', + 'restartInstance', + ]; for (const methodName of dataFusionStubMethods) { const callPromise = this.dataFusionStub.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) => () => { + 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] || @@ -323,9 +369,7 @@ export class DataFusionClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -334,8 +378,9 @@ export class DataFusionClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -347,604 +392,819 @@ export class DataFusionClient { // -- Service calls -- // ------------------- getInstance( - request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; getInstance( - request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; getInstance( - request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. - * 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.getInstance(request); - */ + request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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.getInstance(request); + */ getInstance( - request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.datafusion.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } createInstance( - request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; createInstance( - request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createInstance( - request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ createInstance( - request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @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 - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkCreateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + >; } deleteInstance( - request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; deleteInstance( - request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; deleteInstance( - request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a single Date Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a single Date Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ deleteInstance( - request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @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 - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.datafusion.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.datafusion.v1.OperationMetadata + >; } updateInstance( - request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; updateInstance( - request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; updateInstance( - request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels, - * options, and version currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ updateInstance( - request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @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 - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + >; } restartInstance( - request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; restartInstance( - request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; restartInstance( - request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ restartInstance( - request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.restartInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @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 - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkRestartInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.restartInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1.Instance, + protos.google.cloud.datafusion.v1.OperationMetadata + >; } listAvailableVersions( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IVersion[], - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - ]>; + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ] + >; listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): void; + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + > + ): void; listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): void; -/** - * Lists possible versions for Data Fusion instances in the specified project - * and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1.Version}. - * 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 `listAvailableVersionsAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + > + ): void; + /** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ listAvailableVersions( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): - Promise<[ - protos.google.cloud.datafusion.v1.IVersion[], - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - ]>|void { + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + > + ): Promise< + [ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1.Version} 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 `listAvailableVersionsAsync()` - * 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. - */ + /** + * 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ listAvailableVersionsStream( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -955,53 +1215,52 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 - * [Version]{@link google.cloud.datafusion.v1.Version}. 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listAvailableVersionsAsync( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1013,137 +1272,154 @@ export class DataFusionClient { ) as AsyncIterable; } listInstances( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance[], - protos.google.cloud.datafusion.v1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1.IListInstancesResponse - ]>; + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ] + >; listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): void; + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + > + ): void; listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): void; -/** - * Lists Data Fusion instances in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. - * 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 `listInstancesAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + > + ): void; + /** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ listInstances( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance[], - protos.google.cloud.datafusion.v1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1.IListInstancesResponse - ]>|void { + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listInstances(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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance} 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 `listInstancesAsync()` - * 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. - */ + /** + * 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance} 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 `listInstancesAsync()` + * 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. + */ listInstancesStream( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1154,55 +1430,54 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listInstances`, 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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 - * [Instance]{@link google.cloud.datafusion.v1.Instance}. 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listInstancesAsync( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); @@ -1225,7 +1500,7 @@ export class DataFusionClient { * @param {string} instance * @returns {string} Resource name string. */ - instancePath(project:string,location:string,instance:string) { + instancePath(project: string, location: string, instance: string) { return this.pathTemplates.instancePathTemplate.render({ project: project, location: location, diff --git a/packages/google-cloud-datafusion/src/v1/gapic_metadata.json b/packages/google-cloud-datafusion/src/v1/gapic_metadata.json index b2dd33303e9..fe9fae8ce47 100644 --- a/packages/google-cloud-datafusion/src/v1/gapic_metadata.json +++ b/packages/google-cloud-datafusion/src/v1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.datafusion.v1", - "libraryPackage": "@google-cloud/datafusion", + "libraryPackage": "@google-cloud/data-fusion", "services": { "DataFusion": { "clients": { diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index ea8fc9ee7d2..48d48632e67 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -18,10 +18,18 @@ /* global window */ import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -30,7 +38,7 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './data_fusion_client_config.json'; -import { operationsProtos } from 'google-gax'; +import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -98,11 +106,16 @@ export class DataFusionClient { constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DataFusionClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); + 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'); + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. @@ -120,7 +133,7 @@ export class DataFusionClient { this._opts = opts; // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; // Set useJWTAccessWithScope on the auth object. this.auth.useJWTAccessWithScope = true; @@ -134,10 +147,7 @@ export class DataFusionClient { } // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; if (typeof process !== 'undefined' && 'versions' in process) { clientHeader.push(`gl-node/${process.versions.node}`); } else { @@ -145,7 +155,7 @@ export class DataFusionClient { } if (!opts.fallback) { clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { + } else if (opts.fallback === 'rest') { clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); } if (opts.libName && opts.libVersion) { @@ -170,14 +180,26 @@ export class DataFusionClient { // (e.g. 50 results at a time, with tokens to get subsequent // pages). Denote the keys used for pagination and results. this.descriptors.page = { - listAvailableVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listNamespaces: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'namespaces'), - listDnsPeerings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dnsPeerings') + listAvailableVersions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'availableVersions' + ), + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + listNamespaces: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'namespaces' + ), + listDnsPeerings: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'dnsPeerings' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -186,58 +208,78 @@ export class DataFusionClient { // an Operation object that allows for tracking of the operation, // rather than holding a request open. - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.Instance' + ) as gax.protobuf.Type; const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; + '.google.protobuf.Empty' + ) as gax.protobuf.Type; const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.Instance' + ) as gax.protobuf.Type; const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.Instance' + ) as gax.protobuf.Type; const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; const upgradeInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.Instance' + ) as gax.protobuf.Type; const upgradeInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; + '.google.cloud.datafusion.v1beta1.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), deleteInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), updateInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), restartInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)), + restartInstanceMetadata.decode.bind(restartInstanceMetadata) + ), upgradeInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, upgradeInstanceResponse.decode.bind(upgradeInstanceResponse), - upgradeInstanceMetadata.decode.bind(upgradeInstanceMetadata)) + upgradeInstanceMetadata.decode.bind(upgradeInstanceMetadata) + ), }; // Put together the default options sent with requests. this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.datafusion.v1beta1.DataFusion', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + 'google.cloud.datafusion.v1beta1.DataFusion', + 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 @@ -268,28 +310,47 @@ export class DataFusionClient { // Put together the "service stub" for // google.cloud.datafusion.v1beta1.DataFusion. this.dataFusionStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1beta1.DataFusion') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.datafusion.v1beta1.DataFusion' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any (this._protos as any).google.cloud.datafusion.v1beta1.DataFusion, - this._opts, this._providedCustomServicePath) as Promise<{[method: string]: Function}>; + 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 dataFusionStubMethods = - ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance', 'upgradeInstance', 'removeIamPolicy', 'listNamespaces', 'addDnsPeering', 'removeDnsPeering', 'listDnsPeerings']; + const dataFusionStubMethods = [ + 'listAvailableVersions', + 'listInstances', + 'getInstance', + 'createInstance', + 'deleteInstance', + 'updateInstance', + 'restartInstance', + 'upgradeInstance', + 'removeIamPolicy', + 'listNamespaces', + 'addDnsPeering', + 'removeDnsPeering', + 'listDnsPeerings', + ]; for (const methodName of dataFusionStubMethods) { const callPromise = this.dataFusionStub.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) => () => { + 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] || @@ -338,9 +399,7 @@ export class DataFusionClient { * @returns {string[]} List of default scopes. */ static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; + return ['https://www.googleapis.com/auth/cloud-platform']; } getProjectId(): Promise; @@ -349,8 +408,9 @@ export class DataFusionClient { * 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 { + getProjectId( + callback?: Callback + ): Promise | void { if (callback) { this.auth.getProjectId(callback); return; @@ -362,920 +422,1259 @@ export class DataFusionClient { // -- Service calls -- // ------------------- getInstance( - request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; getInstance( - request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + | protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; getInstance( - request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. - * 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.getInstance(request); - */ + request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + | protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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.getInstance(request); + */ getInstance( - request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< + request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IInstance, + | protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } removeIamPolicy( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + ( + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | undefined + ), + {} | undefined + ] + >; removeIamPolicy( - request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; removeIamPolicy( - request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Remove IAM policy that is currently set on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * The resource on which IAM policy to be removed is attached to. - * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. - * 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.removeIamPolicy(request); - */ + request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Remove IAM policy that is currently set on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * The resource on which IAM policy to be removed is attached to. + * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. + * 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.removeIamPolicy(request); + */ removeIamPolicy( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, + ( + | protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'resource': request.resource || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + resource: request.resource || '', + }); this.initialize(); return this.innerApiCalls.removeIamPolicy(request, options, callback); } addDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest | undefined, + {} | undefined + ] + >; addDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): void; addDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; -/** - * Add DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be created. - * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering - * Dns peering config. - * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. - * 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.addDnsPeering(request); - */ + request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Add DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be created. + * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering + * Dns peering config. + * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. + * 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.addDnsPeering(request); + */ addDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - optionsOrCallback?: CallOptions|Callback< + request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, + protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.addDnsPeering(request, options, callback); } removeDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + ( + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | undefined + ), + {} | undefined + ] + >; removeDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): void; removeDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; -/** - * Remove DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be removed. - * @param {string} request.zone - * Required. The zone to be removed. - * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. - * 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.removeDnsPeering(request); - */ + request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + callback: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Remove DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be removed. + * @param {string} request.zone + * Required. The zone to be removed. + * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. + * 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.removeDnsPeering(request); + */ removeDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< + request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, + optionsOrCallback?: + | CallOptions + | Callback< protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|undefined, {}|undefined - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, + ( + | protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest + | undefined + ), + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.removeDnsPeering(request, options, callback); } createInstance( - request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; createInstance( - request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; createInstance( - request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * An instance resource. + * @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 + * const [operation] = await client.createInstance(request); + * const [response] = await operation.promise(); + */ createInstance( - request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @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 - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkCreateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `createInstance()`. + * @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 + * const decodedOperation = await checkCreateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + >; } deleteInstance( - request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; deleteInstance( - request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; deleteInstance( - request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ deleteInstance( - request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @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 - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `deleteInstance()`. + * @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 + * const decodedOperation = await checkDeleteInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + >; } updateInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; updateInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; updateInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels and - * options currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + * @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 + * const [operation] = await client.updateInstance(request); + * const [response] = await operation.promise(); + */ updateInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'instance.name': request.instance!.name || '', + }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @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 - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `updateInstance()`. + * @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 + * const decodedOperation = await checkUpdateInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + >; } restartInstance( - request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; restartInstance( - request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; restartInstance( - request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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 + * const [operation] = await client.restartInstance(request); + * const [response] = await operation.promise(); + */ restartInstance( - request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.restartInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @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 - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkRestartInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `restartInstance()`. + * @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 + * const decodedOperation = await checkRestartInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestartInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.restartInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + >; } upgradeInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Upgrade a single Data Fusion instance. - * At the end of an operation instance is fully upgraded. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be upgraded in the form of - * projects/{project}/locations/{location}/instances/{instance} - * Instance will be upgraded with the latest stable version of the Data - * Fusion. - * @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 - * const [operation] = await client.upgradeInstance(request); - * const [response] = await operation.promise(); - */ + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Upgrade a single Data Fusion instance. + * At the end of an operation instance is fully upgraded. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be upgraded in the form of + * projects/{project}/locations/{location}/instances/{instance} + * Instance will be upgraded with the latest stable version of the Data + * Fusion. + * @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 + * const [operation] = await client.upgradeInstance(request); + * const [response] = await operation.promise(); + */ upgradeInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>|void { + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); this.initialize(); return this.innerApiCalls.upgradeInstance(request, options, callback); } -/** - * Check the status of the long running operation returned by `upgradeInstance()`. - * @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 - * const decodedOperation = await checkUpgradeInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpgradeInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); + /** + * Check the status of the long running operation returned by `upgradeInstance()`. + * @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 + * const decodedOperation = await checkUpgradeInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpgradeInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.upgradeInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.upgradeInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.datafusion.v1beta1.Instance, + protos.google.cloud.datafusion.v1beta1.OperationMetadata + >; } listAvailableVersions( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IVersion[], - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ] + >; listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): void; + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + > + ): void; listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): void; -/** - * Lists possible versions for Data Fusion instances in the specified project - * and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version}. - * 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 `listAvailableVersionsAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + > + ): void; + /** + * Lists possible versions for Data Fusion instances in the specified project + * and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version}. + * 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 `listAvailableVersionsAsync()` + * 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. + */ listAvailableVersions( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>, - callback?: PaginationCallback< + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IVersion[], - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version} 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 `listAvailableVersionsAsync()` - * 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. - */ + /** + * 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version} 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 `listAvailableVersionsAsync()` + * 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. + */ listAvailableVersionsStream( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1286,53 +1685,52 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 - * [Version]{@link google.cloud.datafusion.v1beta1.Version}. 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance + * information in the format projects/{project}/locations/{location}. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {boolean} request.latestPatchOnly + * Whether or not to return the latest patch of every available minor version. + * If true, only the latest patch will be returned. Ex. if allowed versions is + * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * @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 + * [Version]{@link google.cloud.datafusion.v1beta1.Version}. 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.listAvailableVersionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listAvailableVersionsAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1344,137 +1742,154 @@ export class DataFusionClient { ) as AsyncIterable; } listInstances( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance[], - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ] + >; listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): void; + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + > + ): void; listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): void; -/** - * Lists Data Fusion instances in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. - * 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 `listInstancesAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + > + ): void; + /** + * Lists Data Fusion instances in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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 `listInstancesAsync()` + * 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. + */ listInstances( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance[], - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listInstances(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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance} 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 `listInstancesAsync()` - * 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. - */ + /** + * 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance} 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 `listInstancesAsync()` + * 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. + */ listInstancesStream( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1485,55 +1900,54 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listInstances`, 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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 - * [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listInstances`, 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 + * The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. If the location is + * specified as '-' (wildcard), then all regions available to the project + * are queried, and the results are aggregated. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {string} request.filter + * List filter. + * @param {string} request.orderBy + * Sort results. Supported values are "name", "name desc", or "" (unsorted). + * @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 + * [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. 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.listInstancesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listInstancesAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); @@ -1545,133 +1959,150 @@ export class DataFusionClient { ) as AsyncIterable; } listNamespaces( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.INamespace[], - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest | null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ] + >; listNamespaces( - request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): void; + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + | protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.INamespace + > + ): void; listNamespaces( - request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): void; -/** - * List namespaces in a given instance - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. - * 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 `listNamespacesAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + | protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.INamespace + > + ): void; + /** + * List namespaces in a given instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. + * 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 `listNamespacesAsync()` + * 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. + */ listNamespaces( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.INamespace[], - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.INamespace + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + | protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.INamespace + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.INamespace[], + protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest | null, + protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listNamespaces(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 instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace} 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 `listNamespacesAsync()` - * 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. - */ + /** + * 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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace} 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 `listNamespacesAsync()` + * 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. + */ listNamespacesStream( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listNamespaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1682,53 +2113,52 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listNamespaces`, 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 instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 - * [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. 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.listNamespacesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listNamespaces`, 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 instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 + * [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. 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.listNamespacesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listNamespacesAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listNamespaces']; const callSettings = defaultCallSettings.merge(options); @@ -1740,123 +2170,140 @@ export class DataFusionClient { ) as AsyncIterable; } listDnsPeerings( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IDnsPeering[], - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse - ]>; + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest | null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ] + >; listDnsPeerings( - request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + | protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering + > + ): void; listDnsPeerings( - request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; -/** - * List DNS peering for a given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. - * 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 `listDnsPeeringsAsync()` - * 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. - */ + request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + | protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering + > + ): void; + /** + * List DNS peering for a given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. + * 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 `listDnsPeeringsAsync()` + * 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. + */ listDnsPeerings( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IDnsPeering[], - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse - ]>|void { + | protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering + >, + callback?: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + | protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IDnsPeering + > + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IDnsPeering[], + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest | null, + protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse + ] + > | void { request = request || {}; let options: CallOptions; if (typeof optionsOrCallback === 'function' && callback === undefined) { callback = optionsOrCallback; options = {}; - } - else { + } else { options = optionsOrCallback as CallOptions; } options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); this.initialize(); return this.innerApiCalls.listDnsPeerings(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 on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @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 [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering} 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 `listDnsPeeringsAsync()` - * 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. - */ + /** + * 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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering} 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 `listDnsPeeringsAsync()` + * 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. + */ listDnsPeeringsStream( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - Transform{ + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions + ): Transform { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); const defaultCallSettings = this._defaults['listDnsPeerings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1867,48 +2314,47 @@ export class DataFusionClient { ); } -/** - * Equivalent to `listDnsPeerings`, 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 on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @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 - * [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. 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.listDnsPeeringsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ + /** + * Equivalent to `listDnsPeerings`, 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 on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @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 + * [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. 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.listDnsPeeringsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ listDnsPeeringsAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - AsyncIterable{ + request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, + options?: CallOptions + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); options = options || {}; const defaultCallSettings = this._defaults['listDnsPeerings']; const callSettings = defaultCallSettings.merge(options); @@ -1931,7 +2377,7 @@ export class DataFusionClient { * @param {string} instance * @returns {string} Resource name string. */ - instancePath(project:string,location:string,instance:string) { + instancePath(project: string, location: string, instance: string) { return this.pathTemplates.instancePathTemplate.render({ project: project, location: location, @@ -1981,7 +2427,12 @@ export class DataFusionClient { * @param {string} namespace * @returns {string} Resource name string. */ - namespacePath(project:string,location:string,instance:string,namespace:string) { + namespacePath( + project: string, + location: string, + instance: string, + namespace: string + ) { return this.pathTemplates.namespacePathTemplate.render({ project: project, location: location, @@ -1998,7 +2449,8 @@ export class DataFusionClient { * @returns {string} A string representing the project. */ matchProjectFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).project; + return this.pathTemplates.namespacePathTemplate.match(namespaceName) + .project; } /** @@ -2009,7 +2461,8 @@ export class DataFusionClient { * @returns {string} A string representing the location. */ matchLocationFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).location; + return this.pathTemplates.namespacePathTemplate.match(namespaceName) + .location; } /** @@ -2020,7 +2473,8 @@ export class DataFusionClient { * @returns {string} A string representing the instance. */ matchInstanceFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).instance; + return this.pathTemplates.namespacePathTemplate.match(namespaceName) + .instance; } /** @@ -2031,7 +2485,8 @@ export class DataFusionClient { * @returns {string} A string representing the namespace. */ matchNamespaceFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).namespace; + return this.pathTemplates.namespacePathTemplate.match(namespaceName) + .namespace; } /** diff --git a/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json b/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json index 24ee6be68aa..50b233f8107 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-datafusion/src/v1beta1/gapic_metadata.json @@ -3,7 +3,7 @@ "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "typescript", "protoPackage": "google.cloud.datafusion.v1beta1", - "libraryPackage": "@google-cloud/datafusion", + "libraryPackage": "@google-cloud/data-fusion", "services": { "DataFusion": { "clients": { diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js index 1efd2377537..9962a7c2cd0 100644 --- a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js @@ -16,9 +16,8 @@ // ** 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 datafusion = require('@google-cloud/datafusion'); +const datafusion = require('@google-cloud/data-fusion'); function main() { const dataFusionClient = new datafusion.DataFusionClient(); diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts index 39d8d911158..997c1111df2 100644 --- a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts @@ -16,7 +16,7 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {DataFusionClient} from '@google-cloud/datafusion'; +import {DataFusionClient} from '@google-cloud/data-fusion'; // check that the client class type name can be used function doStuffWithDataFusionClient(client: DataFusionClient) { diff --git a/packages/google-cloud-datafusion/system-test/install.ts b/packages/google-cloud-datafusion/system-test/install.ts index 1f850b522f3..d2d61c0396f 100644 --- a/packages/google-cloud-datafusion/system-test/install.ts +++ b/packages/google-cloud-datafusion/system-test/install.ts @@ -16,34 +16,36 @@ // ** 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'; +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() { + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.ts' + ).toString(), + }, }; await packNTest(options); }); - it('JavaScript code', async function() { + 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() - } + ts: readFileSync( + './system-test/fixtures/sample/src/index.js' + ).toString(), + }, }; await packNTest(options); }); - }); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index 265b14310df..f86f7143cc0 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -20,7 +20,7 @@ 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 {describe, it} from 'mocha'; import * as datafusionModule from '../src'; import {PassThrough} from 'stream'; @@ -28,1315 +28,1735 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; 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; + 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]); + 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 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 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 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]); - } +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(); }); + } + 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({}); + }); } - return sinon.stub().returns(mockStream); + 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); +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.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1.DataFusionClient.servicePath; - assert(servicePath); + it('has servicePath', () => { + const servicePath = datafusionModule.v1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1.DataFusionClient({ + fallback: true, }); + assert(client); + }); - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has port', () => { - const port = datafusionModule.v1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('should create a client with no option', () => { - const client = new datafusionModule.v1.DataFusionClient(); - assert(client); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1.DataFusionClient({ - fallback: true, - }); - assert(client); + 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 datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); + 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); + } + }); }); - - it('has close method', () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1.DataFusionClient({ - 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('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1.DataFusionClient({ - 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); + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getInstance with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes deleteInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes deleteInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes updateInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInstance(request), expectedError); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes restartInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1.IInstance, + protos.google.cloud.datafusion.v1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes restartInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restartInstance(request), expectedError); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes restartInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.innerApiCalls.listAvailableVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1.IVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listAvailableVersions', () => { - it('invokes listAvailableVersions without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listAvailableVersions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAvailableVersions(request), + expectedError + ); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listAvailableVersions without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAvailableVersions( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1.Version) => { + 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.listAvailableVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAvailableVersions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersions with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAvailableVersions(request), expectedError); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1.Version) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAvailableVersions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersionsStream without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { - 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.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersionsStream with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('uses async iteration with listAvailableVersions without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; - const iterable = client.listAvailableVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAvailableVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listInstances with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { - 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.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listInstancesStream with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listInstances without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listInstances with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('Path templates', () => { - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index db993ba4c82..9b66e7c7a88 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -20,7 +20,7 @@ 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 {describe, it} from 'mocha'; import * as datafusionModule from '../src'; import {PassThrough} from 'stream'; @@ -28,2211 +28,3004 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; 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; + 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]); + 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 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 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 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]); - } +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(); }); + } + 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({}); + }); } - return sinon.stub().returns(mockStream); + 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); +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('v1beta1.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; - assert(servicePath); + it('has servicePath', () => { + const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = datafusionModule.v1beta1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new datafusionModule.v1beta1.DataFusionClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + fallback: true, }); + assert(client); + }); - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has port', () => { - const port = datafusionModule.v1beta1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); + }); + + it('has close method', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('should create a client with no option', () => { - const client = new datafusionModule.v1beta1.DataFusionClient(); - assert(client); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - fallback: true, - }); - assert(client); + 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 datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); + 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); + } + }); }); - - it('has close method', () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getInstance', () => { + it('invokes getInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ); + client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); + const [response] = await client.getInstance(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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('invokes getInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IInstance | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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); + it('invokes getInstance with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getInstance = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getInstance(request), expectedError); + assert( + (client.innerApiCalls.getInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - - describe('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getInstance with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + }); + + describe('removeIamPolicy', () => { + it('invokes removeIamPolicy without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse() + ); + client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); + const [response] = await client.removeIamPolicy(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('removeIamPolicy', () => { - it('invokes removeIamPolicy without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); - client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.removeIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeIamPolicy without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); - client.innerApiCalls.removeIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeIamPolicy( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeIamPolicy with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeIamPolicy(request), expectedError); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes removeIamPolicy without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse() + ); + client.innerApiCalls.removeIamPolicy = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeIamPolicy( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('addDnsPeering', () => { - it('invokes addDnsPeering without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); - client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); - const [response] = await client.addDnsPeering(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addDnsPeering without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); - client.innerApiCalls.addDnsPeering = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addDnsPeering( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addDnsPeering with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addDnsPeering = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addDnsPeering(request), expectedError); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes removeIamPolicy with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeIamPolicy = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeIamPolicy(request), expectedError); + assert( + (client.innerApiCalls.removeIamPolicy as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - - describe('removeDnsPeering', () => { - it('invokes removeDnsPeering without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); - client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); - const [response] = await client.removeDnsPeering(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDnsPeering without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); - client.innerApiCalls.removeDnsPeering = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDnsPeering( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeDnsPeering with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDnsPeering = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDnsPeering(request), expectedError); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + }); + + describe('addDnsPeering', () => { + it('invokes addDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse() + ); + client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.addDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes addDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse() + ); + client.innerApiCalls.addDnsPeering = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.addDnsPeering( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes addDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.addDnsPeering = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.addDnsPeering(request), expectedError); + assert( + (client.innerApiCalls.addDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('removeDnsPeering', () => { + it('invokes removeDnsPeering without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse() + ); + client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); + const [response] = await client.removeDnsPeering(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes removeDnsPeering without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse() + ); + client.innerApiCalls.removeDnsPeering = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.removeDnsPeering( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes deleteInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes removeDnsPeering with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.removeDnsPeering = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.removeDnsPeering(request), expectedError); + assert( + (client.innerApiCalls.removeDnsPeering as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes deleteInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes deleteInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes createInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createInstance(request), expectedError); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes createInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes checkCreateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes checkCreateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkCreateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes updateInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes deleteInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteInstance(request), expectedError); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes deleteInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes updateInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkDeleteInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkDeleteInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkDeleteInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes updateInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes updateInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateInstance(request), expectedError); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); }); - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes updateInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() + ); + request.instance = {}; + request.instance.name = ''; + const expectedHeaderRequestParams = 'instance.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes restartInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes checkUpdateInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes restartInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkUpdateInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpdateInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('restartInstance', () => { + it('invokes restartInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restartInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes restartInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes restartInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restartInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restartInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes restartInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restartInstance(request), expectedError); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes restartInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restartInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restartInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.restartInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes checkRestartInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - describe('upgradeInstance', () => { - it('invokes upgradeInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.upgradeInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes checkRestartInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkRestartInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('upgradeInstance', () => { + it('invokes upgradeInstance without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.upgradeInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes upgradeInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.upgradeInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upgradeInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes upgradeInstance without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.upgradeInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.upgradeInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); - it('invokes upgradeInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.upgradeInstance(request), expectedError); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes upgradeInstance with call error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.upgradeInstance(request), expectedError); + assert( + (client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes upgradeInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.upgradeInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes upgradeInstance with LRO error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.upgradeInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.upgradeInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.upgradeInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes checkUpgradeInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpgradeInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); + it('invokes checkUpgradeInstanceProgress without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); - it('invokes checkUpgradeInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const expectedError = new Error('expected'); + it('invokes checkUpgradeInstanceProgress with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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.checkUpgradeInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listAvailableVersions', () => { + it('invokes listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + ]; + client.innerApiCalls.listAvailableVersions = + stubSimpleCall(expectedResponse); + const [response] = await client.listAvailableVersions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - client.operationsClient.getOperation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.checkUpgradeInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); + it('invokes listAvailableVersions without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + ]; + client.innerApiCalls.listAvailableVersions = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listAvailableVersions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IVersion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listAvailableVersions', () => { - it('invokes listAvailableVersions without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listAvailableVersions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAvailableVersions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listAvailableVersions(request), + expectedError + ); + assert( + (client.innerApiCalls.listAvailableVersions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listAvailableVersions without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAvailableVersions( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listAvailableVersionsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + ]; + client.descriptors.page.listAvailableVersions.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Version) => { + 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.listAvailableVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAvailableVersions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersions with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAvailableVersions(request), expectedError); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listAvailableVersionsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listAvailableVersionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Version) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ) + .getCall(0) + .calledWith(client.innerApiCalls.listAvailableVersions, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersionsStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { - 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.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listAvailableVersions without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Version() + ), + ]; + client.descriptors.page.listAvailableVersions.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + const iterable = client.listAvailableVersionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listAvailableVersionsStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listAvailableVersions with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAvailableVersions.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listAvailableVersionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listAvailableVersions + .asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('uses async iteration with listAvailableVersions without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; - const iterable = client.listAvailableVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes listInstances without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAvailableVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listInstances = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listInstances(request), expectedError); + assert( + (client.innerApiCalls.listInstances as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listInstances without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listInstancesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + ]; + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + 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.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listInstances with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listInstancesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listInstancesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Instance) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listInstances, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listInstancesStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { - 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.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listInstances without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; + const iterable = client.listInstancesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listInstancesStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listInstances with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listInstancesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listInstances.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listNamespaces', () => { + it('invokes listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + ]; + client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); + const [response] = await client.listNamespaces(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('uses async iteration with listInstances without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes listNamespaces without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + ]; + client.innerApiCalls.listNamespaces = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listNamespaces( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.INamespace[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listNamespaces', () => { - it('invokes listNamespaces without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); - const [response] = await client.listNamespaces(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listNamespaces = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listNamespaces(request), expectedError); + assert( + (client.innerApiCalls.listNamespaces as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listNamespaces without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.innerApiCalls.listNamespaces = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNamespaces( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.INamespace[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); + it('invokes listNamespacesStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + ]; + client.descriptors.page.listNamespaces.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + 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.listNamespaces.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNamespaces, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNamespaces.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listNamespaces with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listNamespaces = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNamespaces(request), expectedError); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); + it('invokes listNamespacesStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listNamespacesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listNamespaces, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listNamespaces.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listNamespacesStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNamespacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { - 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.listNamespaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); - assert.strictEqual( - (client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listNamespaces without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.Namespace() + ), + ]; + client.descriptors.page.listNamespaces.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; + const iterable = client.listNamespacesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listNamespaces.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNamespaces.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('invokes listNamespacesStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNamespacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); - assert.strictEqual( - (client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listNamespaces with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listNamespaces.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listNamespacesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listNamespaces.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listNamespaces.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('listDnsPeerings', () => { + it('invokes listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + ]; + client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); + const [response] = await client.listDnsPeerings(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('uses async iteration with listNamespaces without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; - const iterable = client.listNamespacesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); + it('invokes listDnsPeerings without error using callback', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + ]; + client.innerApiCalls.listDnsPeerings = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDnsPeerings( + request, + ( + err?: Error | null, + result?: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listNamespaces with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNamespacesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); }); - describe('listDnsPeerings', () => { - it('invokes listDnsPeerings without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); - const [response] = await client.listDnsPeerings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDnsPeerings without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.innerApiCalls.listDnsPeerings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDnsPeerings( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IDnsPeering[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDnsPeerings with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDnsPeerings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDnsPeerings(request), expectedError); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDnsPeeringsStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDnsPeeringsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { - 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.listDnsPeerings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDnsPeerings = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDnsPeerings(request), expectedError); + assert( + (client.innerApiCalls.listDnsPeerings as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); - it('invokes listDnsPeeringsStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDnsPeeringsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listDnsPeeringsStream without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + ]; + client.descriptors.page.listDnsPeerings.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + 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.listDnsPeerings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDnsPeerings, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listDnsPeerings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listDnsPeerings without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; - const iterable = client.listDnsPeeringsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('invokes listDnsPeeringsStream with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listDnsPeeringsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = + []; + stream.on( + 'data', + (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDnsPeerings, request) + ); + assert.strictEqual( + ( + client.descriptors.page.listDnsPeerings.createStream as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); - it('uses async iteration with listDnsPeerings with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDnsPeeringsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); + it('uses async iteration with listDnsPeerings without error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.DnsPeering() + ), + ]; + client.descriptors.page.listDnsPeerings.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = + []; + const iterable = client.listDnsPeeringsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); }); - describe('Path templates', () => { - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + it('uses async iteration with listDnsPeerings with error', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listDnsPeerings.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDnsPeeringsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = + []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert.strictEqual( + ( + client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub + ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.instancePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.instancePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('instancePath', () => { + const result = client.instancePath( + 'projectValue', + 'locationValue', + 'instanceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.instancePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromInstanceName', () => { + const result = client.matchProjectFromInstanceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromInstanceName', () => { + const result = client.matchLocationFromInstanceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromInstanceName', () => { + const result = client.matchInstanceFromInstanceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.instancePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); - describe('namespace', () => { - const fakePath = "/rendered/path/namespace"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - namespace: "namespaceValue", - }; - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.namespacePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.namespacePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('namespacePath', () => { - const result = client.namespacePath("projectValue", "locationValue", "instanceValue", "namespaceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.namespacePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNamespaceName', () => { - const result = client.matchProjectFromNamespaceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNamespaceName', () => { - const result = client.matchLocationFromNamespaceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromNamespaceName', () => { - const result = client.matchInstanceFromNamespaceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNamespaceFromNamespaceName', () => { - const result = client.matchNamespaceFromNamespaceName(fakePath); - assert.strictEqual(result, "namespaceValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); + describe('namespace', () => { + const fakePath = '/rendered/path/namespace'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + namespace: 'namespaceValue', + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.namespacePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.namespacePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('namespacePath', () => { + const result = client.namespacePath( + 'projectValue', + 'locationValue', + 'instanceValue', + 'namespaceValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.namespacePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromNamespaceName', () => { + const result = client.matchProjectFromNamespaceName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromNamespaceName', () => { + const result = client.matchLocationFromNamespaceName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromNamespaceName', () => { + const result = client.matchInstanceFromNamespaceName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchNamespaceFromNamespaceName', () => { + const result = client.matchNamespaceFromNamespaceName(fakePath); + assert.strictEqual(result, 'namespaceValue'); + assert( + (client.pathTemplates.namespacePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); }); + }); }); diff --git a/packages/google-cloud-datafusion/v1/.eslintignore b/packages/google-cloud-datafusion/v1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/packages/google-cloud-datafusion/v1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/packages/google-cloud-datafusion/v1/.eslintrc.json b/packages/google-cloud-datafusion/v1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/packages/google-cloud-datafusion/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/packages/google-cloud-datafusion/v1/.gitignore b/packages/google-cloud-datafusion/v1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/packages/google-cloud-datafusion/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.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-datafusion/v1/.jsdoc.js b/packages/google-cloud-datafusion/v1/.jsdoc.js deleted file mode 100644 index 37689bedd59..00000000000 --- a/packages/google-cloud-datafusion/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -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 2021 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/datafusion', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/packages/google-cloud-datafusion/v1/.mocharc.js b/packages/google-cloud-datafusion/v1/.mocharc.js deleted file mode 100644 index 50bc7f79235..00000000000 --- a/packages/google-cloud-datafusion/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -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-datafusion/v1/.prettierrc.js b/packages/google-cloud-datafusion/v1/.prettierrc.js deleted file mode 100644 index 84f4713a055..00000000000 --- a/packages/google-cloud-datafusion/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/packages/google-cloud-datafusion/v1/README.md b/packages/google-cloud-datafusion/v1/README.md deleted file mode 100644 index a92302cfdbe..00000000000 --- a/packages/google-cloud-datafusion/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Datafusion: Nodejs Client diff --git a/packages/google-cloud-datafusion/v1/linkinator.config.json b/packages/google-cloud-datafusion/v1/linkinator.config.json deleted file mode 100644 index 29a223b6db6..00000000000 --- a/packages/google-cloud-datafusion/v1/linkinator.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io" - ], - "silent": true, - "concurrency": 10 -} diff --git a/packages/google-cloud-datafusion/v1/package.json b/packages/google-cloud-datafusion/v1/package.json deleted file mode 100644 index 91794b18fed..00000000000 --- a/packages/google-cloud-datafusion/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/datafusion", - "version": "0.1.0", - "description": "Datafusion client for Node.js", - "repository": "googleapis/nodejs-datafusion", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google datafusion", - "datafusion", - "data fusion" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.19.0" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^14.17.3", - "@types/sinon": "^10.0.2", - "c8": "^7.7.3", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.0", - "jsdoc-region-tag": "^1.1.0", - "linkinator": "^2.13.6", - "mocha": "^9.0.2", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^11.1.1", - "ts-loader": "^9.2.3", - "typescript": "^4.3.4", - "webpack": "^5.39.1", - "webpack-cli": "^4.7.2" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto b/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto deleted file mode 100644 index aae228337b8..00000000000 --- a/packages/google-cloud-datafusion/v1/protos/google/cloud/datafusion/v1/datafusion.proto +++ /dev/null @@ -1,519 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.datafusion.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.DataFusion.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1;datafusion"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datafusion.v1"; -option php_namespace = "Google\\Cloud\\DataFusion\\V1"; -option ruby_package = "Google::Cloud::DataFusion::V1"; - -// Service for creating and managing Data Fusion instances. -// Data Fusion enables ETL developers to build code-free, data integration -// pipelines via a point-and-click UI. -service DataFusion { - option (google.api.default_host) = "datafusion.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists possible versions for Data Fusion instances in the specified project - // and location. - rpc ListAvailableVersions(ListAvailableVersionsRequest) - returns (ListAvailableVersionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/versions" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Data Fusion instances in the specified project and location. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/instances" - }; - } - - // Gets details of a single Data Fusion instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/instances/*}" - }; - } - - // Creates a new Data Fusion instance in the specified project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Date Fusion instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Updates a single Data Fusion instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Restart a single Data Fusion instance. - // At the end of an operation instance is fully restarted. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/instances/*}:restart" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } -} - -// Network configuration for a Data Fusion instance. These configurations -// are used for peering with the customer network. Configurations are optional -// when a public Data Fusion instance is to be created. However, providing -// these configurations allows several benefits, such as reduced network latency -// while accessing the customer resources from managed Data Fusion instance -// nodes, as well as access to the customer on-prem resources. -message NetworkConfig { - // Name of the network in the customer project with which the Tenant Project - // will be peered for executing pipelines. In case of shared VPC where the - // network resides in another host project the network should specified in - // the form of projects/{host-project-id}/global/networks/{network} - string network = 1; - - // The IP range in CIDR notation to use for the managed Data Fusion instance - // nodes. This range must not overlap with any other ranges used in the - // customer network. - string ip_allocation = 2; -} - -// The Data Fusion version. This proto message stores information about certain -// Data Fusion version, which is used for Data Fusion version upgrade. -message Version { - // The version number of the Data Fusion instance, such as '6.0.1.0'. - string version_number = 1; - - // Whether this is currently the default version for Cloud Data Fusion - bool default_version = 2; - - // Represents a list of available feature names for a given version. - repeated string available_features = 3; -} - -// Identifies Data Fusion accelerators for an instance. -message Accelerator { - // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion - // service. - enum AcceleratorType { - // Default value, if unspecified. - ACCELERATOR_TYPE_UNSPECIFIED = 0; - - // Change Data Capture accelerator for CDF. - CDC = 1; - - // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud - // Healthcare specific CDF plugins developed by Healthcare team. - HEALTHCARE = 2; - - // Contact Center AI Insights - // This accelerator is used to enable import and export pipelines - // custom built to streamline CCAI Insights processing. - CCAI_INSIGHTS = 3; - } - - // Different values possible for the state of an accelerator - enum State { - // Default value, do not use - STATE_UNSPECIFIED = 0; - - // Indicates that the accelerator is enabled and available to use - ENABLED = 1; - - // Indicates that the accelerator is disabled and not available to use - DISABLED = 2; - - // Indicates that accelerator state is currently unknown. - // Requests for enable, disable could be retried while in this state - UNKNOWN = 3; - } - - // The type of an accelator for a CDF instance. - AcceleratorType accelerator_type = 1; - - // The state of the accelerator - State state = 2; -} - -// The crypto key configuration. This field is used by the Customer-managed -// encryption keys (CMEK) feature. -message CryptoKeyConfig { - // The name of the key which is used to encrypt/decrypt customer data. For key - // in Cloud KMS, the key should be in the format of - // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string key_reference = 1; -} - -// Represents a Data Fusion instance. -message Instance { - option (google.api.resource) = { - type: "datafusion.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/instances/{instance}" - }; - - // Represents the type of Data Fusion instance. Each type is configured with - // the default settings for processing and memory. - enum Type { - // No type specified. The instance creation will fail. - TYPE_UNSPECIFIED = 0; - - // Basic Data Fusion instance. In Basic type, the user will be able to - // create data pipelines using point and click UI. However, there are - // certain limitations, such as fewer number of concurrent pipelines, no - // support for streaming pipelines, etc. - BASIC = 1; - - // Enterprise Data Fusion instance. In Enterprise type, the user will have - // all features available, such as support for streaming pipelines, higher - // number of concurrent pipelines, etc. - ENTERPRISE = 2; - - // Developer Data Fusion instance. In Developer type, the user will have all - // features available but with restrictive capabilities. This is to help - // enterprises design and develop their data ingestion and integration - // pipelines at low cost. - DEVELOPER = 3; - } - - // Represents the state of a Data Fusion instance - enum State { - // Instance does not have a state yet - STATE_UNSPECIFIED = 0; - - // Instance is being created - CREATING = 1; - - // Instance is active and ready for requests. This corresponds to 'RUNNING' - // in datafusion.v1beta1. - ACTIVE = 2; - - // Instance creation failed - FAILED = 3; - - // Instance is being deleted - DELETING = 4; - - // Instance is being upgraded - UPGRADING = 5; - - // Instance is being restarted - RESTARTING = 6; - - // Instance is being updated on customer request - UPDATING = 7; - - // Instance is being auto-updated - AUTO_UPDATING = 8; - - // Instance is being auto-upgraded - AUTO_UPGRADING = 9; - } - - // Output only. The name of this instance is in the form of - // projects/{project}/locations/{location}/instances/{instance}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A description of this instance. - string description = 2; - - // Required. Instance type. - Type type = 3 [(google.api.field_behavior) = REQUIRED]; - - // Option to enable Stackdriver Logging. - bool enable_stackdriver_logging = 4; - - // Option to enable Stackdriver Monitoring. - bool enable_stackdriver_monitoring = 5; - - // Specifies whether the Data Fusion instance should be private. If set to - // true, all Data Fusion nodes will have private IP addresses and will not be - // able to access the public internet. - bool private_instance = 6; - - // Network configuration options. These are required when a private Data - // Fusion instance is to be created. - NetworkConfig network_config = 7; - - // The resource labels for instance to use to annotate any related underlying - // resources such as Compute Engine VMs. The character '=' is not allowed to - // be used within the labels. - map labels = 8; - - // Map of additional options used to configure the behavior of - // Data Fusion instance. - map options = 9; - - // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the instance was last updated. - google.protobuf.Timestamp update_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of this Data Fusion instance. - State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional information about the current state of this Data - // Fusion instance if available. - string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Endpoint on which the Data Fusion UI is accessible. - string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Name of the zone in which the Data Fusion instance will be created. Only - // DEVELOPER instances use this field. - string zone = 15; - - // Current version of the Data Fusion. Only specifiable in Update. - string version = 16; - - // Output only. Deprecated. Use tenant_project_id instead to extract the - // tenant project ID. - string service_account = 17 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name for an instance. - string display_name = 18; - - // Available versions that the instance can be upgraded to using - // UpdateInstanceRequest. - repeated Version available_version = 19; - - // Output only. Endpoint on which the REST APIs is accessible. - string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud Storage bucket generated by Data Fusion in the customer - // project. - string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // List of accelerators enabled for this CDF instance. - repeated Accelerator accelerators = 22; - - // Output only. P4 service account for the customer project. - string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the tenant project. - string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-managed service account to set on Dataproc when Cloud Data Fusion - // creates Dataproc to run data processing pipelines. - // - // This allows users to have fine-grained access control on Dataproc's - // accesses to cloud resources. - string dataproc_service_account = 25; - - // Option to enable granular role-based access control. - bool enable_rbac = 27; - - // The crypto key configuration. This field is used by the Customer-Managed - // Encryption Keys (CMEK) feature. - CryptoKeyConfig crypto_key_config = 28; -} - -// Request message for listing Data Fusion instances. -message ListInstancesRequest { - // The project and location for which to retrieve instance information - // in the format projects/{project}/locations/{location}. If the location is - // specified as '-' (wildcard), then all regions available to the project - // are queried, and the results are aggregated. - string parent = 1; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; - - // List filter. - string filter = 4; - - // Sort results. Supported values are "name", "name desc", or "" (unsorted). - string order_by = 5; -} - -// Response message for the list instance request. -message ListInstancesResponse { - // Represents a list of Data Fusion instances. - repeated Instance instances = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for the list available versions request. -message ListAvailableVersionsRequest { - // Required. The project and location for which to retrieve instance - // information in the format projects/{project}/locations/{location}. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; - - // Whether or not to return the latest patch of every available minor version. - // If true, only the latest patch will be returned. Ex. if allowed versions is - // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - bool latest_patch_only = 4; -} - -// Response message for the list available versions request. -message ListAvailableVersionsResponse { - // Represents a list of versions that are supported. - repeated Version available_versions = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for getting details about a Data Fusion instance. -message GetInstanceRequest { - // The instance resource name in the format - // projects/{project}/locations/{location}/instances/{instance}. - string name = 1; -} - -// Request message for creating a Data Fusion instance. -message CreateInstanceRequest { - // The instance's project and location in the format - // projects/{project}/locations/{location}. - string parent = 1; - - // The name of the instance to create. - string instance_id = 2; - - // An instance resource. - Instance instance = 3; -} - -// Request message for deleting a Data Fusion instance. -message DeleteInstanceRequest { - // The instance resource name in the format - // projects/{project}/locations/{location}/instances/{instance} - string name = 1; -} - -message UpdateInstanceRequest { - // The instance resource that replaces the resource on the server. Currently, - // Data Fusion only allows replacing labels, options, and stack driver - // settings. All other fields will be ignored. - Instance instance = 1; - - // Field mask is used to specify the fields that the update will overwrite - // in an instance resource. 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, all the supported fields (labels, - // options, and version currently) will be overwritten. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for restarting a Data Fusion instance. -message RestartInstanceRequest { - // Name of the Data Fusion instance which need to be restarted in the form of - // projects/{project}/locations/{location}/instances/{instance} - string name = 1; -} - -// Represents the metadata of a long-running operation. -message OperationMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1; - - // The time the operation finished running. - google.protobuf.Timestamp end_time = 2; - - // Server-defined resource path for the target of the operation. - string target = 3; - - // Name of the verb executed by the operation. - string verb = 4; - - // Human-readable status of the operation if any. - string status_detail = 5; - - // Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - bool requested_cancellation = 6; - - // API version used to start the operation. - string api_version = 7; - - // Map to hold any additional status info for the operation - // If there is an accelerator being enabled/disabled/deleted, this will be - // populated with accelerator name as key and status as - // ENABLING, DISABLING or DELETING - map additional_status = 8; -} diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js deleted file mode 100644 index b09e4d001ec..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.create_instance.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_CreateInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance's project and location in the format - * projects/{project}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The name of the instance to create. - */ - // const instanceId = 'abc123' - /** - * An instance resource. - */ - // const instance = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function createInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - createInstance(); - // [END datafusion_v1_generated_DataFusion_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js deleted file mode 100644 index cde15d47f32..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.delete_instance.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_DeleteInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function deleteInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - deleteInstance(); - // [END datafusion_v1_generated_DataFusion_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js deleted file mode 100644 index 1945250c1b5..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.get_instance.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_GetInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function getInstance() { - // Construct request - const request = { - }; - - // Run request - const response = await datafusionClient.getInstance(request); - console.log(response); - } - - getInstance(); - // [END datafusion_v1_generated_DataFusion_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js deleted file mode 100644 index 9d43499b31a..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_available_versions.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main(parent) { - // [START datafusion_v1_generated_DataFusion_ListAvailableVersions_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - /** - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - */ - // const latestPatchOnly = true - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listAvailableVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await datafusionClient.listAvailableVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listAvailableVersions(); - // [END datafusion_v1_generated_DataFusion_ListAvailableVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js deleted file mode 100644 index be588b26034..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.list_instances.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_ListInstances_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - */ - // const orderBy = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listInstances() { - // Construct request - const request = { - }; - - // Run request - const iterable = await datafusionClient.listInstancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listInstances(); - // [END datafusion_v1_generated_DataFusion_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js deleted file mode 100644 index a879d529a74..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.restart_instance.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_RestartInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function restartInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.restartInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - restartInstance(); - // [END datafusion_v1_generated_DataFusion_RestartInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js deleted file mode 100644 index f25496040e9..00000000000 --- a/packages/google-cloud-datafusion/v1/samples/generated/v1/data_fusion.update_instance.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1_generated_DataFusion_UpdateInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - */ - // const instance = '' - /** - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels, - * options, and version currently) will be overwritten. - */ - // const updateMask = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function updateInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.updateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - updateInstance(); - // [END datafusion_v1_generated_DataFusion_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1/src/index.ts b/packages/google-cloud-datafusion/v1/src/index.ts deleted file mode 100644 index 5fa9f20abbc..00000000000 --- a/packages/google-cloud-datafusion/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const DataFusionClient = v1.DataFusionClient; -type DataFusionClient = v1.DataFusionClient; -export {v1, DataFusionClient}; -export default {v1, DataFusionClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts deleted file mode 100644 index fe982d87cca..00000000000 --- a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client.ts +++ /dev/null @@ -1,1286 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/data_fusion_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './data_fusion_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Service for creating and managing Data Fusion instances. - * Data Fusion enables ETL developers to build code-free, data integration - * pipelines via a point-and-click UI. - * @class - * @memberof v1 - */ -export class DataFusionClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - dataFusionStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DataFusionClient. - * - * @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/master/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} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DataFusionClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - }; - - // 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 = { - listAvailableVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances') - }; - - 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. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; - const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.Instance') as gax.protobuf.Type; - const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - restartInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.datafusion.v1.DataFusion', 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 = gax.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.dataFusionStub) { - return this.dataFusionStub; - } - - // Put together the "service stub" for - // google.cloud.datafusion.v1.DataFusion. - this.dataFusionStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1.DataFusion') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.datafusion.v1.DataFusion, - 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 dataFusionStubMethods = - ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance']; - for (const methodName of dataFusionStubMethods) { - const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; - } - - return this.dataFusionStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'datafusion.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 'datafusion.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 -- - // ------------------- - getInstance( - request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. - * 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.getInstance(request); - */ - getInstance( - request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance, - protos.google.cloud.datafusion.v1.IGetInstanceRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); - } - - createInstance( - request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ - createInstance( - request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @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 - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkCreateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - deleteInstance( - request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a single Date Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ - deleteInstance( - request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @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 - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - updateInstance( - request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels, - * options, and version currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ - updateInstance( - request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @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 - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - restartInstance( - request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartInstance( - request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ - restartInstance( - request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.restartInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @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 - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkRestartInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IVersion[], - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - ]>; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): void; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): void; -/** - * Lists possible versions for Data Fusion instances in the specified project - * and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1.Version}. - * 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 `listAvailableVersionsAsync()` - * 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. - */ - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1.IVersion>): - Promise<[ - protos.google.cloud.datafusion.v1.IVersion[], - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1.Version} 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 `listAvailableVersionsAsync()` - * 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. - */ - listAvailableVersionsStream( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAvailableVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAvailableVersions.createStream( - this.innerApiCalls.listAvailableVersions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 - * [Version]{@link google.cloud.datafusion.v1.Version}. 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listAvailableVersionsAsync( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listAvailableVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAvailableVersions.asyncIterate( - this.innerApiCalls['listAvailableVersions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - listInstances( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance[], - protos.google.cloud.datafusion.v1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1.IListInstancesResponse - ]>; - listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): void; - listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): void; -/** - * Lists Data Fusion instances in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. - * 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 `listInstancesAsync()` - * 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. - */ - listInstances( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - protos.google.cloud.datafusion.v1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1.IInstance>): - Promise<[ - protos.google.cloud.datafusion.v1.IInstance[], - protos.google.cloud.datafusion.v1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1.IListInstancesResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listInstances(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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance} 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 `listInstancesAsync()` - * 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. - */ - listInstancesStream( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, 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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 - * [Instance]{@link google.cloud.datafusion.v1.Instance}. 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listInstancesAsync( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * 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 { - this.initialize(); - if (!this._terminated) { - return this.dataFusionStub!.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json deleted file mode 100644 index 531f4845eab..00000000000 --- a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_client_config.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "interfaces": { - "google.cloud.datafusion.v1.DataFusion": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListAvailableVersions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json deleted file mode 100644 index b7898b94f83..00000000000 --- a/packages/google-cloud-datafusion/v1/src/v1/data_fusion_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/datafusion/v1/datafusion.proto" -] diff --git a/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json b/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json deleted file mode 100644 index b2dd33303e9..00000000000 --- a/packages/google-cloud-datafusion/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.datafusion.v1", - "libraryPackage": "@google-cloud/datafusion", - "services": { - "DataFusion": { - "clients": { - "grpc": { - "libraryClient": "DataFusionClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "ListAvailableVersions": { - "methods": [ - "listAvailableVersions", - "listAvailableVersionsStream", - "listAvailableVersionsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DataFusionClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "ListAvailableVersions": { - "methods": [ - "listAvailableVersions", - "listAvailableVersionsStream", - "listAvailableVersionsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - } - } - } - } - } - } -} diff --git a/packages/google-cloud-datafusion/v1/src/v1/index.ts b/packages/google-cloud-datafusion/v1/src/v1/index.ts deleted file mode 100644 index 6dd78dbfb06..00000000000 --- a/packages/google-cloud-datafusion/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1efd2377537..00000000000 --- a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const datafusion = require('@google-cloud/datafusion'); - -function main() { - const dataFusionClient = new datafusion.DataFusionClient(); -} - -main(); diff --git a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 39d8d911158..00000000000 --- a/packages/google-cloud-datafusion/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DataFusionClient} from '@google-cloud/datafusion'; - -// check that the client class type name can be used -function doStuffWithDataFusionClient(client: DataFusionClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dataFusionClient = new DataFusionClient(); - doStuffWithDataFusionClient(dataFusionClient); -} - -main(); diff --git a/packages/google-cloud-datafusion/v1/system-test/install.ts b/packages/google-cloud-datafusion/v1/system-test/install.ts deleted file mode 100644 index 1f850b522f3..00000000000 --- a/packages/google-cloud-datafusion/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -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-datafusion/v1/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts deleted file mode 100644 index 265b14310df..00000000000 --- a/packages/google-cloud-datafusion/v1/test/gapic_data_fusion_v1.ts +++ /dev/null @@ -1,1342 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -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 datafusionModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -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.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1.DataFusionClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datafusionModule.v1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datafusionModule.v1.DataFusionClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1.DataFusionClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); - }); - - it('has close method', () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1.DataFusionClient({ - 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 datafusionModule.v1.DataFusionClient({ - 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('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getInstance with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes restartInstance without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes restartInstance with call error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes restartInstance with LRO error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - 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.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listAvailableVersions', () => { - it('invokes listAvailableVersions without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listAvailableVersions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAvailableVersions without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAvailableVersions( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAvailableVersions with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAvailableVersions(request), expectedError); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAvailableVersionsStream without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { - 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.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listAvailableVersionsStream with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), - ]; - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; - const iterable = client.listAvailableVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAvailableVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listInstances with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { - 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.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/packages/google-cloud-datafusion/v1/tsconfig.json b/packages/google-cloud-datafusion/v1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/packages/google-cloud-datafusion/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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-datafusion/v1/webpack.config.js b/packages/google-cloud-datafusion/v1/webpack.config.js deleted file mode 100644 index 7346a1e4405..00000000000 --- a/packages/google-cloud-datafusion/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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: 'DataFusion', - filename: './data-fusion.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/packages/google-cloud-datafusion/v1beta1/.eslintignore b/packages/google-cloud-datafusion/v1beta1/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ -samples/generated/ diff --git a/packages/google-cloud-datafusion/v1beta1/.eslintrc.json b/packages/google-cloud-datafusion/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/packages/google-cloud-datafusion/v1beta1/.gitignore b/packages/google-cloud-datafusion/v1beta1/.gitignore deleted file mode 100644 index 5d32b23782f..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.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-datafusion/v1beta1/.jsdoc.js b/packages/google-cloud-datafusion/v1beta1/.jsdoc.js deleted file mode 100644 index 37689bedd59..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -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 2021 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/datafusion', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/packages/google-cloud-datafusion/v1beta1/.mocharc.js b/packages/google-cloud-datafusion/v1beta1/.mocharc.js deleted file mode 100644 index 50bc7f79235..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -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-datafusion/v1beta1/.prettierrc.js b/packages/google-cloud-datafusion/v1beta1/.prettierrc.js deleted file mode 100644 index 84f4713a055..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/packages/google-cloud-datafusion/v1beta1/README.md b/packages/google-cloud-datafusion/v1beta1/README.md deleted file mode 100644 index a92302cfdbe..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Datafusion: Nodejs Client diff --git a/packages/google-cloud-datafusion/v1beta1/linkinator.config.json b/packages/google-cloud-datafusion/v1beta1/linkinator.config.json deleted file mode 100644 index 29a223b6db6..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/linkinator.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io" - ], - "silent": true, - "concurrency": 10 -} diff --git a/packages/google-cloud-datafusion/v1beta1/package.json b/packages/google-cloud-datafusion/v1beta1/package.json deleted file mode 100644 index 91794b18fed..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/datafusion", - "version": "0.1.0", - "description": "Datafusion client for Node.js", - "repository": "googleapis/nodejs-datafusion", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google datafusion", - "datafusion", - "data fusion" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.19.0" - }, - "devDependencies": { - "@types/mocha": "^9.0.0", - "@types/node": "^14.17.3", - "@types/sinon": "^10.0.2", - "c8": "^7.7.3", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.0", - "jsdoc-region-tag": "^1.1.0", - "linkinator": "^2.13.6", - "mocha": "^9.0.2", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^11.1.1", - "ts-loader": "^9.2.3", - "typescript": "^4.3.4", - "webpack": "^5.39.1", - "webpack-cli": "^4.7.2" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto b/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto deleted file mode 100644 index d3f9565f92d..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/protos/google/cloud/datafusion/v1beta1/v1beta1.proto +++ /dev/null @@ -1,712 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.datafusion.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/iam/v1/policy.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.DataFusion.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/datafusion/v1beta1;datafusion"; -option java_multiple_files = true; -option java_package = "com.google.cloud.datafusion.v1beta1"; -option php_namespace = "Google\\Cloud\\DataFusion\\V1beta1"; -option ruby_package = "Google::Cloud::DataFusion::V1beta1"; - -// Service for creating and managing Data Fusion instances. -// Data Fusion enables ETL developers to build code-free, data integration -// pipelines via a point-and-click UI. -service DataFusion { - option (google.api.default_host) = "datafusion.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists possible versions for Data Fusion instances in the specified project - // and location. - rpc ListAvailableVersions(ListAvailableVersionsRequest) - returns (ListAvailableVersionsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/versions" - }; - option (google.api.method_signature) = "parent"; - } - - // Lists Data Fusion instances in the specified project and location. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/instances" - }; - } - - // Gets details of a single Data Fusion instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/instances/*}" - }; - } - - // Creates a new Data Fusion instance in the specified project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance,instance_id"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single Data Fusion instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Updates a single Data Fusion instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "instance,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Restart a single Data Fusion instance. - // At the end of an operation instance is fully restarted. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restart" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Upgrade a single Data Fusion instance. - // At the end of an operation instance is fully upgraded. - rpc UpgradeInstance(UpgradeInstanceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "Instance" - metadata_type: "OperationMetadata" - }; - } - - // Remove IAM policy that is currently set on the given resource. - rpc RemoveIamPolicy(RemoveIamPolicyRequest) - returns (RemoveIamPolicyResponse) { - option (google.api.http) = { - post: "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy" - body: "*" - }; - } - - // List namespaces in a given instance - rpc ListNamespaces(ListNamespacesRequest) returns (ListNamespacesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/namespaces" - }; - option (google.api.method_signature) = "parent"; - } - - // Add DNS peering on the given resource. - rpc AddDnsPeering(AddDnsPeeringRequest) returns (AddDnsPeeringResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:add" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // Remove DNS peering on the given resource. - rpc RemoveDnsPeering(RemoveDnsPeeringRequest) - returns (RemoveDnsPeeringResponse) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove" - body: "*" - }; - option (google.api.method_signature) = "parent"; - } - - // List DNS peering for a given resource. - rpc ListDnsPeerings(ListDnsPeeringsRequest) - returns (ListDnsPeeringsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list" - }; - option (google.api.method_signature) = "parent"; - } -} - -// Network configuration for a Data Fusion instance. These configurations -// are used for peering with the customer network. Configurations are optional -// when a public Data Fusion instance is to be created. However, providing -// these configurations allows several benefits, such as reduced network latency -// while accessing the customer resources from managed Data Fusion instance -// nodes, as well as access to the customer on-prem resources. -message NetworkConfig { - // Name of the network in the customer project with which the Tenant Project - // will be peered for executing pipelines. In case of shared VPC where the - // network resides in another host project the network should specified in - // the form of projects/{host-project-id}/global/networks/{network} - string network = 1; - - // The IP range in CIDR notation to use for the managed Data Fusion instance - // nodes. This range must not overlap with any other ranges used in the Data - // Fusion instance network. - string ip_allocation = 2; -} - -// The Data Fusion version. -message Version { - // The version number of the Data Fusion instance, such as '6.0.1.0'. - string version_number = 1; - - // Whether this is currently the default version for Cloud Data Fusion - bool default_version = 2; - - // Represents a list of available feature names for a given version. - repeated string available_features = 3; -} - -// Identifies Data Fusion accelerators for an instance. -message Accelerator { - // Each type represents an Accelerator (Add-On) supported by Cloud Data Fusion - // service. - enum AcceleratorType { - // Default value, if unspecified. - ACCELERATOR_TYPE_UNSPECIFIED = 0; - - // Change Data Capture accelerator for CDF. - CDC = 1; - - // Cloud Healthcare accelerator for CDF. This accelerator is to enable Cloud - // Healthcare specific CDF plugins developed by Healthcare team. - HEALTHCARE = 2; - } - - // The type of an accelator for a CDF instance. - AcceleratorType accelerator_type = 1; -} - -// The crypto key configuration. This field is used by the Customer-managed -// encryption keys (CMEK) feature. -message CryptoKeyConfig { - // The name of the key which is used to encrypt/decrypt customer data. For key - // in Cloud KMS, the key should be in the format of - // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string key_reference = 1; -} - -// Represents a Data Fusion instance. -message Instance { - option (google.api.resource) = { - type: "datafusion.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/instances/{instance}" - }; - - // Represents the type of Data Fusion instance. Each type is configured with - // the default settings for processing and memory. - enum Type { - // No type specified. The instance creation will fail. - TYPE_UNSPECIFIED = 0; - - // Basic Data Fusion instance. In Basic type, the user will be able to - // create data pipelines using point and click UI. However, there are - // certain limitations, such as fewer number of concurrent pipelines, no - // support for streaming pipelines, etc. - BASIC = 1; - - // Enterprise Data Fusion instance. In Enterprise type, the user will have - // all features available, such as support for streaming pipelines, - // unlimited number of concurrent pipelines, etc. - ENTERPRISE = 2; - - // Developer Data Fusion instance. In Developer type, the user will have all - // features available but with restrictive capabilities. This is to help - // enterprises design and develop their data ingestion and integration - // pipelines at low cost. - DEVELOPER = 3; - } - - // Represents the state of a Data Fusion instance - enum State { - // Instance does not have a state yet - STATE_UNSPECIFIED = 0; - - // Instance is being created - CREATING = 1; - - // Instance is running and ready for requests - RUNNING = 2; - - // Instance creation failed - FAILED = 3; - - // Instance is being deleted - DELETING = 4; - - // Instance is being upgraded - UPGRADING = 5; - - // Instance is being restarted - RESTARTING = 6; - - // Instance is being updated on customer request - UPDATING = 7; - - // Instance is being auto-updated - AUTO_UPDATING = 8; - - // Instance is being auto-upgraded - AUTO_UPGRADING = 9; - } - - // Output only. The name of this instance is in the form of - // projects/{project}/locations/{location}/instances/{instance}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A description of this instance. - string description = 2; - - // Required. Instance type. - Type type = 3 [(google.api.field_behavior) = REQUIRED]; - - // Option to enable Stackdriver Logging. - bool enable_stackdriver_logging = 4; - - // Option to enable Stackdriver Monitoring. - bool enable_stackdriver_monitoring = 5; - - // Specifies whether the Data Fusion instance should be private. If set to - // true, all Data Fusion nodes will have private IP addresses and will not be - // able to access the public internet. - bool private_instance = 6; - - // Network configuration options. These are required when a private Data - // Fusion instance is to be created. - NetworkConfig network_config = 7; - - // The resource labels for instance to use to annotate any related underlying - // resources such as Compute Engine VMs. The character '=' is not allowed to - // be used within the labels. - map labels = 8; - - // Map of additional options used to configure the behavior of - // Data Fusion instance. - map options = 9; - - // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the instance was last updated. - google.protobuf.Timestamp update_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of this Data Fusion instance. - State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional information about the current state of this Data - // Fusion instance if available. - string state_message = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Endpoint on which the Data Fusion UI is accessible. - string service_endpoint = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Name of the zone in which the Data Fusion instance will be created. Only - // DEVELOPER instances use this field. - string zone = 15; - - // Current version of Data Fusion. - string version = 16; - - // Output only. Deprecated. Use tenant_project_id instead to extract the - // tenant project ID. - string service_account = 17 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; - - // Display name for an instance. - string display_name = 18; - - // Available versions that the instance can be upgraded to using - // UpdateInstanceRequest. - repeated Version available_version = 19; - - // Output only. Endpoint on which the REST APIs is accessible. - string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud Storage bucket generated by Data Fusion in the customer - // project. - string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // List of accelerators enabled for this CDF instance. - repeated Accelerator accelerators = 22; - - // Output only. P4 service account for the customer project. - string p4_service_account = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The name of the tenant project. - string tenant_project_id = 24 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User-managed service account to set on Dataproc when Cloud Data Fusion - // creates Dataproc to run data processing pipelines. - // - // This allows users to have fine-grained access control on Dataproc's - // accesses to cloud resources. - string dataproc_service_account = 25; - - // Option to enable granular role-based access control. - bool enable_rbac = 26; - - // The crypto key configuration. This field is used by the Customer-Managed - // Encryption Keys (CMEK) feature. - CryptoKeyConfig crypto_key_config = 27; -} - -// Request message for listing Data Fusion instances. -message ListInstancesRequest { - // The project and location for which to retrieve instance information - // in the format projects/{project}/locations/{location}. If the location is - // specified as '-' (wildcard), then all regions available to the project - // are queried, and the results are aggregated. - string parent = 1; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; - - // List filter. - string filter = 4; - - // Sort results. Supported values are "name", "name desc", or "" (unsorted). - string order_by = 5; -} - -// Response message for the list instance request. -message ListInstancesResponse { - // Represents a list of Data Fusion instances. - repeated Instance instances = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for the list available versions request. -message ListAvailableVersionsRequest { - // Required. The project and location for which to retrieve instance - // information in the format projects/{project}/locations/{location}. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; - - // Whether or not to return the latest patch of every available minor version. - // If true, only the latest patch will be returned. Ex. if allowed versions is - // [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - bool latest_patch_only = 4; -} - -// Response message for the list available versions request. -message ListAvailableVersionsResponse { - // Represents a list of versions that are supported. - repeated Version available_versions = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for getting details about a Data Fusion instance. -message GetInstanceRequest { - // The instance resource name in the format - // projects/{project}/locations/{location}/instances/{instance}. - string name = 1; -} - -// Request message for creating a Data Fusion instance. -message CreateInstanceRequest { - // The instance's project and location in the format - // projects/{project}/locations/{location}. - string parent = 1; - - // The name of the instance to create. - string instance_id = 2; - - // An instance resource. - Instance instance = 3; -} - -// Request message for deleting a Data Fusion instance. -message DeleteInstanceRequest { - // The instance resource name in the format - // projects/{project}/locations/{location}/instances/{instance} - string name = 1; -} - -// Request message for updating a Data Fusion instance. -// Data Fusion only allows updating the labels, options, and stack driver -// settings. -message UpdateInstanceRequest { - // The instance resource that replaces the resource on the server. Currently, - // Data Fusion only allows replacing labels, options, and stack driver - // settings. All other fields will be ignored. - Instance instance = 1; - - // Field mask is used to specify the fields that the update will overwrite - // in an instance resource. 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, all the supported fields (labels and - // options currently) will be overwritten. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for restarting a Data Fusion instance. -message RestartInstanceRequest { - // Name of the Data Fusion instance which need to be restarted in the form of - // projects/{project}/locations/{location}/instances/{instance} - string name = 1; -} - -// Request message for upgrading a Data Fusion instance. -// To change the instance properties, instance update should be used. -message UpgradeInstanceRequest { - // Name of the Data Fusion instance which need to be upgraded in the form of - // projects/{project}/locations/{location}/instances/{instance} - // Instance will be upgraded with the latest stable version of the Data - // Fusion. - string name = 1; -} - -// Represents the metadata of a long-running operation. -message OperationMetadata { - // The time the operation was created. - google.protobuf.Timestamp create_time = 1; - - // The time the operation finished running. - google.protobuf.Timestamp end_time = 2; - - // Server-defined resource path for the target of the operation. - string target = 3; - - // Name of the verb executed by the operation. - string verb = 4; - - // Human-readable status of the operation if any. - string status_detail = 5; - - // Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. - bool requested_cancellation = 6; - - // API version used to start the operation. - string api_version = 7; -} - -// Request message for RemoveIamPolicy method. -message RemoveIamPolicyRequest { - // The resource on which IAM policy to be removed is attached to. - string resource = 1; -} - -// Response message for RemoveIamPolicy method. -message RemoveIamPolicyResponse {} - -// List namespaces request. -message ListNamespacesRequest { - // Required. The instance to list its namespaces. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datafusion.googleapis.com/Instance" - } - ]; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; - - // By default, only basic information about a namespace is returned - // (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - // information associated with a namespace gets returned - // (e.g. IAM policy set on the namespace) - NamespaceView view = 4; -} - -// IAMPolicy encapsulates the IAM policy name, definition and status of -// policy fetching. -message IAMPolicy { - // Policy definition if IAM policy fetching is successful, - // otherwise empty. - google.iam.v1.Policy policy = 1; - - // Status of iam policy fetching. - google.rpc.Status status = 2; -} - -// Represents the information of a namespace -message Namespace { - option (google.api.resource) = { - type: "datafusion.googleapis.com/Namespace" - pattern: "projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}" - }; - - // Name of the given namespace. - string name = 1; - - // IAM policy associated with this namespace. - IAMPolicy iam_policy = 2; -} - -// List namespaces response. -message ListNamespacesResponse { - // List of namespaces - repeated Namespace namespaces = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// DNS peering configuration. These configurations are used to create -// DNS peering with the customer Cloud DNS. -message DnsPeering { - // Required. Name of the zone. - string zone = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Name of the dns. - string domain = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Optional description of the dns zone. - string description = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Optional target project to which dns peering should happen. - string target_project = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Optional target network to which dns peering should happen. - string target_network = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message to create dns peering. -message AddDnsPeeringRequest { - // The resource on which DNS peering will be created. - string parent = 1; - - // Dns peering config. - DnsPeering dns_peering = 2; -} - -// Response message for set dns peering method. -message AddDnsPeeringResponse {} - -// A view for Namespace -enum NamespaceView { - // Default/unset value, which will use BASIC view. - NAMESPACE_VIEW_UNSPECIFIED = 0; - - // Show the most basic metadata of a namespace - NAMESPACE_VIEW_BASIC = 1; - - // Returns all metadata of a namespace - NAMESPACE_VIEW_FULL = 2; -} - -// Request message to remove dns peering. -message RemoveDnsPeeringRequest { - // The resource on which DNS peering will be removed. - string parent = 1; - - // Required. The zone to be removed. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for set dns peering method. -message RemoveDnsPeeringResponse {} - -// List dns peering request. -message ListDnsPeeringsRequest { - // Required. The resource on which dns peering will be listed. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "datafusion.googleapis.com/Instance" - } - ]; - - // The maximum number of items to return. - int32 page_size = 2; - - // The next_page_token value to use if there are additional - // results to retrieve for this list request. - string page_token = 3; -} - -// List dns peering response. -message ListDnsPeeringsResponse { - // List of dns peering configs. - repeated DnsPeering dns_peerings = 1; - - // Token to retrieve the next page of results or empty if there are no more - // results in the list. - string next_page_token = 2; -} diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js deleted file mode 100644 index 81fb01a370a..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The resource on which DNS peering will be created. - */ - // const parent = 'abc123' - /** - * Dns peering config. - */ - // const dnsPeering = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function addDnsPeering() { - // Construct request - const request = { - }; - - // Run request - const response = await datafusionClient.addDnsPeering(request); - console.log(response); - } - - addDnsPeering(); - // [END datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js deleted file mode 100644 index 1f88908871d..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.create_instance.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_CreateInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance's project and location in the format - * projects/{project}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The name of the instance to create. - */ - // const instanceId = 'abc123' - /** - * An instance resource. - */ - // const instance = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function createInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.createInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - createInstance(); - // [END datafusion_v1beta1_generated_DataFusion_CreateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js deleted file mode 100644 index e03cda45f63..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.delete_instance.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function deleteInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.deleteInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - deleteInstance(); - // [END datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js deleted file mode 100644 index c1719b4ac00..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.get_instance.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_GetInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function getInstance() { - // Construct request - const request = { - }; - - // Run request - const response = await datafusionClient.getInstance(request); - console.log(response); - } - - getInstance(); - // [END datafusion_v1beta1_generated_DataFusion_GetInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js deleted file mode 100644 index 2c7920b4aef..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main(parent) { - // [START datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - /** - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - */ - // const latestPatchOnly = true - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listAvailableVersions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await datafusionClient.listAvailableVersionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listAvailableVersions(); - // [END datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js deleted file mode 100644 index 1fbf286ba83..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main(parent) { - // [START datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The resource on which dns peering will be listed. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listDnsPeerings() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await datafusionClient.listDnsPeeringsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listDnsPeerings(); - // [END datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js deleted file mode 100644 index 7ead3148fbc..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_instances.js +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_ListInstances_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - /** - * List filter. - */ - // const filter = 'abc123' - /** - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - */ - // const orderBy = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listInstances() { - // Construct request - const request = { - }; - - // Run request - const iterable = await datafusionClient.listInstancesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listInstances(); - // [END datafusion_v1beta1_generated_DataFusion_ListInstances_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js deleted file mode 100644 index f93b9a5622a..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main(parent) { - // [START datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The instance to list its namespaces. - */ - // const parent = 'abc123' - /** - * The maximum number of items to return. - */ - // const pageSize = 1234 - /** - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - */ - // const pageToken = 'abc123' - /** - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - */ - // const view = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function listNamespaces() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = await datafusionClient.listNamespacesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - listNamespaces(); - // [END datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js deleted file mode 100644 index 1fb6a727dca..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main(zone) { - // [START datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The resource on which DNS peering will be removed. - */ - // const parent = 'abc123' - /** - * Required. The zone to be removed. - */ - // const zone = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function removeDnsPeering() { - // Construct request - const request = { - zone, - }; - - // Run request - const response = await datafusionClient.removeDnsPeering(request); - console.log(response); - } - - removeDnsPeering(); - // [END datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js deleted file mode 100644 index ed5f2043bf4..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The resource on which IAM policy to be removed is attached to. - */ - // const resource = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function removeIamPolicy() { - // Construct request - const request = { - }; - - // Run request - const response = await datafusionClient.removeIamPolicy(request); - console.log(response); - } - - removeIamPolicy(); - // [END datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js deleted file mode 100644 index 61720548f38..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.restart_instance.js +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_RestartInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function restartInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.restartInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - restartInstance(); - // [END datafusion_v1beta1_generated_DataFusion_RestartInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js deleted file mode 100644 index d04f0db8b0e..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.update_instance.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - */ - // const instance = '' - /** - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels and - * options currently) will be overwritten. - */ - // const updateMask = '' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function updateInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.updateInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - updateInstance(); - // [END datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js deleted file mode 100644 index 888f2e90b56..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - - -'use strict'; - -function main() { - // [START datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] - /** - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Name of the Data Fusion instance which need to be upgraded in the form of - * projects/{project}/locations/{location}/instances/{instance} - * Instance will be upgraded with the latest stable version of the Data - * Fusion. - */ - // const name = 'abc123' - - // Imports the Datafusion library - const {DataFusionClient} = require('@google-cloud/datafusion').v1beta1; - - // Instantiates a client - const datafusionClient = new DataFusionClient(); - - async function upgradeInstance() { - // Construct request - const request = { - }; - - // Run request - const [operation] = await datafusionClient.upgradeInstance(request); - const [response] = await operation.promise(); - console.log(response); - } - - upgradeInstance(); - // [END datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/packages/google-cloud-datafusion/v1beta1/src/index.ts b/packages/google-cloud-datafusion/v1beta1/src/index.ts deleted file mode 100644 index 00c3afc66c3..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta1 from './v1beta1'; -const DataFusionClient = v1beta1.DataFusionClient; -type DataFusionClient = v1beta1.DataFusionClient; -export {v1beta1, DataFusionClient}; -export default {v1beta1, DataFusionClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts deleted file mode 100644 index ea8fc9ee7d2..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client.ts +++ /dev/null @@ -1,2054 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions, LROperation, PaginationCallback, GaxCall} from 'google-gax'; - -import { Transform } from 'stream'; -import { RequestType } from 'google-gax/build/src/apitypes'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/data_fusion_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './data_fusion_client_config.json'; -import { operationsProtos } from 'google-gax'; -const version = require('../../../package.json').version; - -/** - * Service for creating and managing Data Fusion instances. - * Data Fusion enables ETL developers to build code-free, data integration - * pipelines via a point-and-click UI. - * @class - * @memberof v1beta1 - */ -export class DataFusionClient { - private _terminated = false; - private _opts: ClientOptions; - private _providedCustomServicePath: boolean; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - dataFusionStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of DataFusionClient. - * - * @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/master/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} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof DataFusionClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - this._providedCustomServicePath = !!(opts?.servicePath || opts?.apiEndpoint); - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set useJWTAccessWithScope on the auth object. - this.auth.useJWTAccessWithScope = true; - - // Set defaultServicePath on the auth object. - this.auth.defaultServicePath = staticMembers.servicePath; - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - instancePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}' - ), - namespacePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}' - ), - }; - - // 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 = { - listAvailableVersions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'availableVersions'), - listInstances: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'instances'), - listNamespaces: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'namespaces'), - listDnsPeerings: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dnsPeerings') - }; - - 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. - - this.operationsClient = this._gaxModule.lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined - }).operationsClient(opts); - const createInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; - const createInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; - const deleteInstanceResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; - const updateInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; - const updateInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; - const restartInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; - const restartInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; - const upgradeInstanceResponse = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.Instance') as gax.protobuf.Type; - const upgradeInstanceMetadata = protoFilesRoot.lookup( - '.google.cloud.datafusion.v1beta1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createInstanceResponse.decode.bind(createInstanceResponse), - createInstanceMetadata.decode.bind(createInstanceMetadata)), - deleteInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteInstanceResponse.decode.bind(deleteInstanceResponse), - deleteInstanceMetadata.decode.bind(deleteInstanceMetadata)), - updateInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateInstanceResponse.decode.bind(updateInstanceResponse), - updateInstanceMetadata.decode.bind(updateInstanceMetadata)), - restartInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restartInstanceResponse.decode.bind(restartInstanceResponse), - restartInstanceMetadata.decode.bind(restartInstanceMetadata)), - upgradeInstance: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - upgradeInstanceResponse.decode.bind(upgradeInstanceResponse), - upgradeInstanceMetadata.decode.bind(upgradeInstanceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.datafusion.v1beta1.DataFusion', 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 = gax.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.dataFusionStub) { - return this.dataFusionStub; - } - - // Put together the "service stub" for - // google.cloud.datafusion.v1beta1.DataFusion. - this.dataFusionStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.datafusion.v1beta1.DataFusion') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.datafusion.v1beta1.DataFusion, - 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 dataFusionStubMethods = - ['listAvailableVersions', 'listInstances', 'getInstance', 'createInstance', 'deleteInstance', 'updateInstance', 'restartInstance', 'upgradeInstance', 'removeIamPolicy', 'listNamespaces', 'addDnsPeering', 'removeDnsPeering', 'listDnsPeerings']; - for (const methodName of dataFusionStubMethods) { - const callPromise = this.dataFusionStub.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.innerApiCalls[methodName] = apiCall; - } - - return this.dataFusionStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'datafusion.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 'datafusion.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 -- - // ------------------- - getInstance( - request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|undefined, {}|undefined - ]>; - getInstance( - request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; - getInstance( - request: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): void; -/** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. - * 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.getInstance(request); - */ - getInstance( - request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest|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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.getInstance(request, options, callback); - } - removeIamPolicy( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|undefined, {}|undefined - ]>; - removeIamPolicy( - request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): void; - removeIamPolicy( - request: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): void; -/** - * Remove IAM policy that is currently set on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * The resource on which IAM policy to be removed is attached to. - * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. - * 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.removeIamPolicy(request); - */ - removeIamPolicy( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest|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' - ] = gax.routingHeader.fromParams({ - 'resource': request.resource || '', - }); - this.initialize(); - return this.innerApiCalls.removeIamPolicy(request, options, callback); - } - addDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|undefined, {}|undefined - ]>; - addDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; - addDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; -/** - * Add DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be created. - * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering - * Dns peering config. - * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. - * 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.addDnsPeering(request); - */ - addDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.addDnsPeering(request, options, callback); - } - removeDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|undefined, {}|undefined - ]>; - removeDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; - removeDnsPeering( - request: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - callback: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): void; -/** - * Remove DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be removed. - * @param {string} request.zone - * Required. The zone to be removed. - * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. - * 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.removeDnsPeering(request); - */ - removeDnsPeering( - request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse, - protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.removeDnsPeering(request, options, callback); - } - - createInstance( - request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createInstance( - request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createInstance( - request: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ - createInstance( - request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.createInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `createInstance()`. - * @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 - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkCreateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.createInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - deleteInstance( - request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteInstance( - request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteInstance( - request: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Deletes a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ - deleteInstance( - request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `deleteInstance()`. - * @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 - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkDeleteInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.deleteInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - updateInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels and - * options currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ - updateInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', - }); - this.initialize(); - return this.innerApiCalls.updateInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `updateInstance()`. - * @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 - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpdateInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.updateInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - restartInstance( - request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restartInstance( - request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restartInstance( - request: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ - restartInstance( - request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.restartInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `restartInstance()`. - * @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 - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkRestartInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.restartInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - upgradeInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; -/** - * Upgrade a single Data Fusion instance. - * At the end of an operation instance is fully upgraded. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be upgraded in the form of - * projects/{project}/locations/{location}/instances/{instance} - * Instance will be upgraded with the latest stable version of the Data - * Fusion. - * @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 - * const [operation] = await client.upgradeInstance(request); - * const [response] = await operation.promise(); - */ - upgradeInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - optionsOrCallback?: CallOptions|Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>, - callback?: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): - Promise<[ - LROperation, - 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' - ] = gax.routingHeader.fromParams({ - 'name': request.name || '', - }); - this.initialize(); - return this.innerApiCalls.upgradeInstance(request, options, callback); - } -/** - * Check the status of the long running operation returned by `upgradeInstance()`. - * @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 - * const decodedOperation = await checkUpgradeInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); - */ - async checkUpgradeInstanceProgress(name: string): Promise>{ - const request = new operationsProtos.google.longrunning.GetOperationRequest({name}); - const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation(operation, this.descriptors.longrunning.upgradeInstance, gax.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IVersion[], - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - ]>; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): void; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): void; -/** - * Lists possible versions for Data Fusion instances in the specified project - * and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version}. - * 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 `listAvailableVersionsAsync()` - * 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. - */ - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IVersion>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IVersion[], - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listAvailableVersions(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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 [Version]{@link google.cloud.datafusion.v1beta1.Version} 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 `listAvailableVersionsAsync()` - * 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. - */ - listAvailableVersionsStream( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listAvailableVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAvailableVersions.createStream( - this.innerApiCalls.listAvailableVersions as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listAvailableVersions`, 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 project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {boolean} request.latestPatchOnly - * Whether or not to return the latest patch of every available minor version. - * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] - * @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 - * [Version]{@link google.cloud.datafusion.v1beta1.Version}. 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listAvailableVersionsAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listAvailableVersions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listAvailableVersions.asyncIterate( - this.innerApiCalls['listAvailableVersions'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - listInstances( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance[], - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - ]>; - listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): void; - listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): void; -/** - * Lists Data Fusion instances in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. - * 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 `listInstancesAsync()` - * 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. - */ - listInstances( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IInstance>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IInstance[], - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listInstances(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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance} 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 `listInstancesAsync()` - * 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. - */ - listInstancesStream( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listInstances`, 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 - * The project and location for which to retrieve instance information - * in the format projects/{project}/locations/{location}. If the location is - * specified as '-' (wildcard), then all regions available to the project - * are queried, and the results are aggregated. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {string} request.filter - * List filter. - * @param {string} request.orderBy - * Sort results. Supported values are "name", "name desc", or "" (unsorted). - * @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 - * [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listInstancesAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listInstances']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - listNamespaces( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.INamespace[], - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse - ]>; - listNamespaces( - request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): void; - listNamespaces( - request: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): void; -/** - * List namespaces in a given instance - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. - * 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 `listNamespacesAsync()` - * 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. - */ - listNamespaces( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.INamespace>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.INamespace[], - protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest|null, - protos.google.cloud.datafusion.v1beta1.IListNamespacesResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listNamespaces(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 instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace} 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 `listNamespacesAsync()` - * 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. - */ - listNamespacesStream( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listNamespaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNamespaces.createStream( - this.innerApiCalls.listNamespaces as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listNamespaces`, 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 instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 - * [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. 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.listNamespacesAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listNamespacesAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listNamespaces']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listNamespaces.asyncIterate( - this.innerApiCalls['listNamespaces'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - listDnsPeerings( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IDnsPeering[], - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse - ]>; - listDnsPeerings( - request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; - listDnsPeerings( - request: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): void; -/** - * List DNS peering for a given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. - * 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 `listDnsPeeringsAsync()` - * 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. - */ - listDnsPeerings( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>, - callback?: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse|null|undefined, - protos.google.cloud.datafusion.v1beta1.IDnsPeering>): - Promise<[ - protos.google.cloud.datafusion.v1beta1.IDnsPeering[], - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest|null, - protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsResponse - ]>|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' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - this.initialize(); - return this.innerApiCalls.listDnsPeerings(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 on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @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 [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering} 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 `listDnsPeeringsAsync()` - * 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. - */ - listDnsPeeringsStream( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - Transform{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - const defaultCallSettings = this._defaults['listDnsPeerings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDnsPeerings.createStream( - this.innerApiCalls.listDnsPeerings as gax.GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDnsPeerings`, 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 on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @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 - * [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. 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.listDnsPeeringsAsync(request); - * for await (const response of iterable) { - * // process response - * } - */ - listDnsPeeringsAsync( - request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, - options?: CallOptions): - AsyncIterable{ - request = request || {}; - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers[ - 'x-goog-request-params' - ] = gax.routingHeader.fromParams({ - 'parent': request.parent || '', - }); - options = options || {}; - const defaultCallSettings = this._defaults['listDnsPeerings']; - const callSettings = defaultCallSettings.merge(options); - this.initialize(); - return this.descriptors.page.listDnsPeerings.asyncIterate( - this.innerApiCalls['listDnsPeerings'] as GaxCall, - request as unknown as RequestType, - callSettings - ) as AsyncIterable; - } - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified instance resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @returns {string} Resource name string. - */ - instancePath(project:string,location:string,instance:string) { - return this.pathTemplates.instancePathTemplate.render({ - project: project, - location: location, - instance: instance, - }); - } - - /** - * Parse the project from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the project. - */ - matchProjectFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).project; - } - - /** - * Parse the location from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the location. - */ - matchLocationFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).location; - } - - /** - * Parse the instance from Instance resource. - * - * @param {string} instanceName - * A fully-qualified path representing Instance resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromInstanceName(instanceName: string) { - return this.pathTemplates.instancePathTemplate.match(instanceName).instance; - } - - /** - * Return a fully-qualified namespace resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} instance - * @param {string} namespace - * @returns {string} Resource name string. - */ - namespacePath(project:string,location:string,instance:string,namespace:string) { - return this.pathTemplates.namespacePathTemplate.render({ - project: project, - location: location, - instance: instance, - namespace: namespace, - }); - } - - /** - * Parse the project from Namespace resource. - * - * @param {string} namespaceName - * A fully-qualified path representing Namespace resource. - * @returns {string} A string representing the project. - */ - matchProjectFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).project; - } - - /** - * Parse the location from Namespace resource. - * - * @param {string} namespaceName - * A fully-qualified path representing Namespace resource. - * @returns {string} A string representing the location. - */ - matchLocationFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).location; - } - - /** - * Parse the instance from Namespace resource. - * - * @param {string} namespaceName - * A fully-qualified path representing Namespace resource. - * @returns {string} A string representing the instance. - */ - matchInstanceFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).instance; - } - - /** - * Parse the namespace from Namespace resource. - * - * @param {string} namespaceName - * A fully-qualified path representing Namespace resource. - * @returns {string} A string representing the namespace. - */ - matchNamespaceFromNamespaceName(namespaceName: string) { - return this.pathTemplates.namespacePathTemplate.match(namespaceName).namespace; - } - - /** - * 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 { - this.initialize(); - if (!this._terminated) { - return this.dataFusionStub!.then(stub => { - this._terminated = true; - stub.close(); - this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json deleted file mode 100644 index fb09a3c732a..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_client_config.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "interfaces": { - "google.cloud.datafusion.v1beta1.DataFusion": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListAvailableVersions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestartInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpgradeInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListNamespaces": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "AddDnsPeering": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RemoveDnsPeering": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDnsPeerings": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json deleted file mode 100644 index ea2e94605fb..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/data_fusion_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/datafusion/v1beta1/v1beta1.proto" -] diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 24ee6be68aa..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,169 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.datafusion.v1beta1", - "libraryPackage": "@google-cloud/datafusion", - "services": { - "DataFusion": { - "clients": { - "grpc": { - "libraryClient": "DataFusionClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "AddDnsPeering": { - "methods": [ - "addDnsPeering" - ] - }, - "RemoveDnsPeering": { - "methods": [ - "removeDnsPeering" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgradeInstance" - ] - }, - "ListAvailableVersions": { - "methods": [ - "listAvailableVersions", - "listAvailableVersionsStream", - "listAvailableVersionsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListNamespaces": { - "methods": [ - "listNamespaces", - "listNamespacesStream", - "listNamespacesAsync" - ] - }, - "ListDnsPeerings": { - "methods": [ - "listDnsPeerings", - "listDnsPeeringsStream", - "listDnsPeeringsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "DataFusionClient", - "rpcs": { - "GetInstance": { - "methods": [ - "getInstance" - ] - }, - "RemoveIamPolicy": { - "methods": [ - "removeIamPolicy" - ] - }, - "AddDnsPeering": { - "methods": [ - "addDnsPeering" - ] - }, - "RemoveDnsPeering": { - "methods": [ - "removeDnsPeering" - ] - }, - "CreateInstance": { - "methods": [ - "createInstance" - ] - }, - "DeleteInstance": { - "methods": [ - "deleteInstance" - ] - }, - "UpdateInstance": { - "methods": [ - "updateInstance" - ] - }, - "RestartInstance": { - "methods": [ - "restartInstance" - ] - }, - "UpgradeInstance": { - "methods": [ - "upgradeInstance" - ] - }, - "ListAvailableVersions": { - "methods": [ - "listAvailableVersions", - "listAvailableVersionsStream", - "listAvailableVersionsAsync" - ] - }, - "ListInstances": { - "methods": [ - "listInstances", - "listInstancesStream", - "listInstancesAsync" - ] - }, - "ListNamespaces": { - "methods": [ - "listNamespaces", - "listNamespacesStream", - "listNamespacesAsync" - ] - }, - "ListDnsPeerings": { - "methods": [ - "listDnsPeerings", - "listDnsPeeringsStream", - "listDnsPeeringsAsync" - ] - } - } - } - } - } - } -} diff --git a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts b/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index 6dd78dbfb06..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {DataFusionClient} from './data_fusion_client'; diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 1efd2377537..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const datafusion = require('@google-cloud/datafusion'); - -function main() { - const dataFusionClient = new datafusion.DataFusionClient(); -} - -main(); diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 39d8d911158..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {DataFusionClient} from '@google-cloud/datafusion'; - -// check that the client class type name can be used -function doStuffWithDataFusionClient(client: DataFusionClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const dataFusionClient = new DataFusionClient(); - doStuffWithDataFusionClient(dataFusionClient); -} - -main(); diff --git a/packages/google-cloud-datafusion/v1beta1/system-test/install.ts b/packages/google-cloud-datafusion/v1beta1/system-test/install.ts deleted file mode 100644 index 1f850b522f3..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -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-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts deleted file mode 100644 index db993ba4c82..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/test/gapic_data_fusion_v1beta1.ts +++ /dev/null @@ -1,2238 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -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 datafusionModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos} from 'google-gax'; - -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('v1beta1.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datafusionModule.v1beta1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datafusionModule.v1beta1.DataFusionClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); - }); - - it('has close method', () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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 datafusionModule.v1beta1.DataFusionClient({ - 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('getInstance', () => { - it('invokes getInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); - const [response] = await client.getInstance(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes getInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()); - client.innerApiCalls.getInstance = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getInstance( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes getInstance with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.getInstance = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getInstance(request), expectedError); - assert((client.innerApiCalls.getInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('removeIamPolicy', () => { - it('invokes removeIamPolicy without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); - client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); - const [response] = await client.removeIamPolicy(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeIamPolicy without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse()); - client.innerApiCalls.removeIamPolicy = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeIamPolicy( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeIamPolicy with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest()); - request.resource = ''; - const expectedHeaderRequestParams = "resource="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeIamPolicy = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeIamPolicy(request), expectedError); - assert((client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('addDnsPeering', () => { - it('invokes addDnsPeering without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); - client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); - const [response] = await client.addDnsPeering(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes addDnsPeering without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse()); - client.innerApiCalls.addDnsPeering = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.addDnsPeering( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes addDnsPeering with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.addDnsPeering = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.addDnsPeering(request), expectedError); - assert((client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('removeDnsPeering', () => { - it('invokes removeDnsPeering without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); - client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); - const [response] = await client.removeDnsPeering(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes removeDnsPeering without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse()); - client.innerApiCalls.removeDnsPeering = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.removeDnsPeering( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes removeDnsPeering with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.removeDnsPeering = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.removeDnsPeering(request), expectedError); - assert((client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('createInstance', () => { - it('invokes createInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.createInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.createInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes createInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createInstance(request), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes createInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.createInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.createInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkCreateInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkCreateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkCreateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes deleteInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteInstance(request), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes deleteInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkDeleteInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkDeleteInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkDeleteInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateInstance', () => { - it('invokes updateInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.updateInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes updateInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateInstance(request), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes updateInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest()); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = "instance.name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.updateInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.updateInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpdateInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpdateInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpdateInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restartInstance', () => { - it('invokes restartInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.restartInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes restartInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.restartInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restartInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes restartInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restartInstance(request), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes restartInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.restartInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restartInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.restartInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkRestartInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkRestartInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestartInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkRestartInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('upgradeInstance', () => { - it('invokes upgradeInstance without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.upgradeInstance(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes upgradeInstance without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage(new protos.google.longrunning.Operation()); - client.innerApiCalls.upgradeInstance = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.upgradeInstance( - request, - (err?: Error|null, - result?: LROperation|null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const operation = await promise as LROperation; - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes upgradeInstance with call error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.upgradeInstance(request), expectedError); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes upgradeInstance with LRO error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest()); - request.name = ''; - const expectedHeaderRequestParams = "name="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.upgradeInstance = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.upgradeInstance(request); - await assert.rejects(operation.promise(), expectedError); - assert((client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes checkUpgradeInstanceProgress without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpgradeInstanceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpgradeInstanceProgress with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - 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.checkUpgradeInstanceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listAvailableVersions', () => { - it('invokes listAvailableVersions without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCall(expectedResponse); - const [response] = await client.listAvailableVersions(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAvailableVersions without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.innerApiCalls.listAvailableVersions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listAvailableVersions( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IVersion[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listAvailableVersions with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listAvailableVersions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listAvailableVersions(request), expectedError); - assert((client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listAvailableVersionsStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { - 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.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listAvailableVersionsStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listAvailableVersionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Version[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Version) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listAvailableVersions, request)); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Version()), - ]; - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; - const iterable = client.listAvailableVersionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listAvailableVersions with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listAvailableVersionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IVersion[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listAvailableVersions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listInstances', () => { - it('invokes listInstances without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstances without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.innerApiCalls.listInstances = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listInstances( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IInstance[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listInstances with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listInstances(request), expectedError); - assert((client.innerApiCalls.listInstances as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listInstancesStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { - 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.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listInstancesStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listInstancesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Instance[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Instance) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listInstances, request)); - assert.strictEqual( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInstances without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Instance()), - ]; - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listInstances with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IInstance[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listNamespaces', () => { - it('invokes listNamespaces without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); - const [response] = await client.listNamespaces(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listNamespaces without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.innerApiCalls.listNamespaces = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listNamespaces( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.INamespace[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listNamespaces with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listNamespaces = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listNamespaces(request), expectedError); - assert((client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listNamespacesStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listNamespacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { - 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.listNamespaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); - assert.strictEqual( - (client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listNamespacesStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listNamespacesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.Namespace[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.Namespace) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listNamespaces, request)); - assert.strictEqual( - (client.descriptors.page.listNamespaces.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listNamespaces without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.Namespace()), - ]; - client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; - const iterable = client.listNamespacesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listNamespaces with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listNamespacesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.INamespace[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('listDnsPeerings', () => { - it('invokes listDnsPeerings without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); - const [response] = await client.listDnsPeerings(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDnsPeerings without error using callback', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.innerApiCalls.listDnsPeerings = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDnsPeerings( - request, - (err?: Error|null, result?: protos.google.cloud.datafusion.v1beta1.IDnsPeering[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listDnsPeerings with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.innerApiCalls.listDnsPeerings = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDnsPeerings(request), expectedError); - assert((client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listDnsPeeringsStream without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDnsPeeringsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { - 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.listDnsPeerings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('invokes listDnsPeeringsStream with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedError = new Error('expected'); - client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDnsPeeringsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.datafusion.v1beta1.DnsPeering[] = []; - stream.on('data', (response: protos.google.cloud.datafusion.v1beta1.DnsPeering) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDnsPeerings, request)); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDnsPeerings without error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent="; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.DnsPeering()), - ]; - client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; - const iterable = client.listDnsPeeringsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - - it('uses async iteration with listDnsPeerings with error', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest()); - request.parent = ''; - const expectedHeaderRequestParams = "parent=";const expectedError = new Error('expected'); - client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDnsPeeringsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.datafusion.v1beta1.IDnsPeering[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert.strictEqual( - (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams - ); - }); - }); - - describe('Path templates', () => { - - describe('instance', () => { - const fakePath = "/rendered/path/instance"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - }; - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.instancePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.instancePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('instancePath', () => { - const result = client.instancePath("projectValue", "locationValue", "instanceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.instancePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromInstanceName', () => { - const result = client.matchProjectFromInstanceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromInstanceName', () => { - const result = client.matchLocationFromInstanceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromInstanceName', () => { - const result = client.matchInstanceFromInstanceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.instancePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('namespace', () => { - const fakePath = "/rendered/path/namespace"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - instance: "instanceValue", - namespace: "namespaceValue", - }; - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - client.pathTemplates.namespacePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.namespacePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('namespacePath', () => { - const result = client.namespacePath("projectValue", "locationValue", "instanceValue", "namespaceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.namespacePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromNamespaceName', () => { - const result = client.matchProjectFromNamespaceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromNamespaceName', () => { - const result = client.matchLocationFromNamespaceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchInstanceFromNamespaceName', () => { - const result = client.matchInstanceFromNamespaceName(fakePath); - assert.strictEqual(result, "instanceValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchNamespaceFromNamespaceName', () => { - const result = client.matchNamespaceFromNamespaceName(fakePath); - assert.strictEqual(result, "namespaceValue"); - assert((client.pathTemplates.namespacePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/packages/google-cloud-datafusion/v1beta1/tsconfig.json b/packages/google-cloud-datafusion/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c884ef..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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-datafusion/v1beta1/webpack.config.js b/packages/google-cloud-datafusion/v1beta1/webpack.config.js deleted file mode 100644 index 7346a1e4405..00000000000 --- a/packages/google-cloud-datafusion/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// 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: 'DataFusion', - filename: './data-fusion.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/packages/google-cloud-datafusion/webpack.config.js b/packages/google-cloud-datafusion/webpack.config.js index 7346a1e4405..839a91f129a 100644 --- a/packages/google-cloud-datafusion/webpack.config.js +++ b/packages/google-cloud-datafusion/webpack.config.js @@ -36,27 +36,27 @@ module.exports = { { test: /\.tsx?$/, use: 'ts-loader', - exclude: /node_modules/ + exclude: /node_modules/, }, { test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]grpc/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]retry-request/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' + use: 'null-loader', }, { test: /node_modules[\\/]gtoken/, - use: 'null-loader' + use: 'null-loader', }, ], }, From 81fad3c5ab94fa69fb4f165b2dd88645d05ed307 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 7 Oct 2021 16:52:48 -0700 Subject: [PATCH 04/47] chore: update package name for npm data-fusion (#3) PiperOrigin-RevId: 401044637 --- .../google-cloud-datafusion/samples/README.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 packages/google-cloud-datafusion/samples/README.md diff --git a/packages/google-cloud-datafusion/samples/README.md b/packages/google-cloud-datafusion/samples/README.md new file mode 100644 index 00000000000..78db90e2c1e --- /dev/null +++ b/packages/google-cloud-datafusion/samples/README.md @@ -0,0 +1,50 @@ +[//]: # "This README.md file is auto-generated, all changes to this file will be lost." +[//]: # "To regenerate it, use `python -m synthtool`." +Google Cloud Platform logo + +# [Cloud Data Fusion: Node.js Samples](https://github.com/googleapis/nodejs-data-fusion) + +[![Open in Cloud Shell][shell_img]][shell_link] + + + +## Table of Contents + +* [Before you begin](#before-you-begin) +* [Samples](#samples) + * [Quickstart](#quickstart) + +## Before you begin + +Before running the samples, make sure you've followed the steps outlined in +[Using the client library](https://github.com/googleapis/nodejs-data-fusion#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-data-fusion/blob/main/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-data-fusion&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node samples/quickstart.js` + + + + + + +[shell_img]: https://gstatic.com/cloudssh/images/open-btn.png +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-data-fusion&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/data-fusion/ From 1b5906bd755594ed4b749bf574f1e276b0627eca Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 8 Oct 2021 00:00:17 +0000 Subject: [PATCH 05/47] chore: release 0.2.0 (#5) :robot: I have created a release \*beep\* \*boop\* --- ## 0.2.0 (2021-10-07) ### Features * add templated files from docker image ([2e5a5c2](https://www.github.com/googleapis/nodejs-data-fusion/commit/2e5a5c2646d7e31887ab788c96dc26c48c877e1e)) * add tests and samples to library ([#1](https://www.github.com/googleapis/nodejs-data-fusion/issues/1)) ([6efc5b9](https://www.github.com/googleapis/nodejs-data-fusion/commit/6efc5b94a5503edcd08f7bcf34f604ad644c2125)) * initial stub of library ([09de8f4](https://www.github.com/googleapis/nodejs-data-fusion/commit/09de8f4482387c1f54aec34b53c8cdf30d8e3f22)) ### Build System * initial release version ([#4](https://www.github.com/googleapis/nodejs-data-fusion/issues/4)) ([c7b6662](https://www.github.com/googleapis/nodejs-data-fusion/commit/c7b66626903c5ad588c244258b511f0a159ffde0)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-datafusion/CHANGELOG.md | 15 +++++++++++++++ packages/google-cloud-datafusion/package.json | 2 +- .../google-cloud-datafusion/samples/package.json | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-datafusion/CHANGELOG.md diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md new file mode 100644 index 00000000000..6737bfafae4 --- /dev/null +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## 0.2.0 (2021-10-07) + + +### Features + +* add templated files from docker image ([2e5a5c2](https://www.github.com/googleapis/nodejs-data-fusion/commit/2e5a5c2646d7e31887ab788c96dc26c48c877e1e)) +* add tests and samples to library ([#1](https://www.github.com/googleapis/nodejs-data-fusion/issues/1)) ([6efc5b9](https://www.github.com/googleapis/nodejs-data-fusion/commit/6efc5b94a5503edcd08f7bcf34f604ad644c2125)) +* initial stub of library ([09de8f4](https://www.github.com/googleapis/nodejs-data-fusion/commit/09de8f4482387c1f54aec34b53c8cdf30d8e3f22)) + + +### Build System + +* initial release version ([#4](https://www.github.com/googleapis/nodejs-data-fusion/issues/4)) ([c7b6662](https://www.github.com/googleapis/nodejs-data-fusion/commit/c7b66626903c5ad588c244258b511f0a159ffde0)) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index b4350dd2610..f084bf15924 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "0.1.0", + "version": "0.2.0", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index c024366b7f0..f64baf0f167 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^0.1.0" + "@google-cloud/data-fusion": "^0.2.0" }, "devDependencies": { "c8": "^7.1.0", From b454edb91c6c0e21579ad287dbe0b63787aa15d4 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Thu, 7 Oct 2021 20:12:51 -0400 Subject: [PATCH 06/47] docs: point to reference docs (#6) --- packages/google-cloud-datafusion/.repo-metadata.json | 2 +- packages/google-cloud-datafusion/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/.repo-metadata.json b/packages/google-cloud-datafusion/.repo-metadata.json index 926b45c6b13..5c6d13f6a85 100644 --- a/packages/google-cloud-datafusion/.repo-metadata.json +++ b/packages/google-cloud-datafusion/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "datafusion", "name_pretty": "Cloud Data Fusion", "product_documentation": "https://cloud.google.com/data-fusion/", - "client_documentation": "https://cloud.google.com/data-fusion", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/datafusion/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/5552618", "release_level": "beta", "language": "nodejs", diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index 0ff1c0f07fc..cec4249f23c 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -116,7 +116,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-data-fusion/blob/main/LICENSE) -[client-docs]: https://cloud.google.com/data-fusion +[client-docs]: https://cloud.google.com/nodejs/docs/reference/datafusion/latest [product-docs]: https://cloud.google.com/data-fusion/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 9556a2a42be0bcd6a0fdeb66be16c4bacf1b3aee Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 12 Oct 2021 18:54:36 +0200 Subject: [PATCH 07/47] chore(deps): update dependency sinon to v11 (#8) --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index f084bf15924..bfffbcca6ac 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -54,7 +54,7 @@ "mocha": "^8.4.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^10.0.0", + "sinon": "^11.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From 820effb37103e66cb85d23e0228f2722d6aa0a6e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 12 Oct 2021 19:05:12 +0200 Subject: [PATCH 08/47] chore(deps): update dependency mocha to v9 (#7) Co-authored-by: Jeffrey Rennie --- packages/google-cloud-datafusion/package.json | 4 ++-- packages/google-cloud-datafusion/samples/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index bfffbcca6ac..a1a5ef25a91 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -42,7 +42,7 @@ "google-gax": "^2.12.0" }, "devDependencies": { - "@types/mocha": "^8.2.2", + "@types/mocha": "^9.0.0", "@types/node": "^14.14.44", "@types/sinon": "^10.0.0", "c8": "^7.7.2", @@ -51,7 +51,7 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.13.6", - "mocha": "^8.4.0", + "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^11.0.0", diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index f64baf0f167..154c58920d6 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -18,6 +18,6 @@ "devDependencies": { "c8": "^7.1.0", "chai": "^4.2.0", - "mocha": "^8.0.0" + "mocha": "^9.0.0" } } From a3928797ac3d189e5a110f1472da9aff62bbc175 Mon Sep 17 00:00:00 2001 From: Justin Beckwith Date: Thu, 14 Oct 2021 08:29:55 -0700 Subject: [PATCH 09/47] docs: update reference api url (#10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: update reference api url * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- packages/google-cloud-datafusion/.repo-metadata.json | 2 +- packages/google-cloud-datafusion/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/.repo-metadata.json b/packages/google-cloud-datafusion/.repo-metadata.json index 5c6d13f6a85..3bec0e20138 100644 --- a/packages/google-cloud-datafusion/.repo-metadata.json +++ b/packages/google-cloud-datafusion/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "datafusion", "name_pretty": "Cloud Data Fusion", "product_documentation": "https://cloud.google.com/data-fusion/", - "client_documentation": "https://cloud.google.com/nodejs/docs/reference/datafusion/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-fusion/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/5552618", "release_level": "beta", "language": "nodejs", diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index cec4249f23c..b19fa824ac2 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -116,7 +116,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-data-fusion/blob/main/LICENSE) -[client-docs]: https://cloud.google.com/nodejs/docs/reference/datafusion/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/data-fusion/latest [product-docs]: https://cloud.google.com/data-fusion/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 455461b0fa58f2ae1c466cf20337b85243fbc85d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 16:24:12 +0000 Subject: [PATCH 10/47] build(node): update deps used during postprocessing (#1243) (#9) --- .../google-cloud-datafusion/protos/protos.d.ts | 3 ++- packages/google-cloud-datafusion/protos/protos.js | 7 +++++++ .../google-cloud-datafusion/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index 8b3b679edab..64edfcf74ed 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -5557,7 +5557,8 @@ export namespace google { OUTPUT_ONLY = 3, INPUT_ONLY = 4, IMMUTABLE = 5, - UNORDERED_LIST = 6 + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7 } /** Properties of a ResourceDescriptor. */ diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index 635b203bc5a..43b4caae23b 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -13372,6 +13372,7 @@ * @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); @@ -13382,6 +13383,7 @@ 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; })(); @@ -19550,6 +19552,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -19654,6 +19657,10 @@ 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) { diff --git a/packages/google-cloud-datafusion/protos/protos.json b/packages/google-cloud-datafusion/protos/protos.json index 292fcccecbf..8f08eed1b0c 100644 --- a/packages/google-cloud-datafusion/protos/protos.json +++ b/packages/google-cloud-datafusion/protos/protos.json @@ -1605,7 +1605,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "resourceReference": { @@ -2248,6 +2249,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 45315a802b6559928897fcc044600ee1723c0fd9 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 06:32:49 -0700 Subject: [PATCH 11/47] chore: fix the wrong post processor image (#14) --- packages/google-cloud-datafusion/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/.github/.OwlBot.yaml b/packages/google-cloud-datafusion/.github/.OwlBot.yaml index 0b54cd56bbf..b18c6a96239 100644 --- a/packages/google-cloud-datafusion/.github/.OwlBot.yaml +++ b/packages/google-cloud-datafusion/.github/.OwlBot.yaml @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. docker: - image: gcr.io/repo-automation-bots/owlbot-nodejs:latest + image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging From d2d109296a9b1642afcd18e8994500e3d53eceeb Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 17:32:58 +0200 Subject: [PATCH 12/47] chore(deps): update dependency @types/node to v16 (#13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^14.14.44` -> `^16.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/14.17.32/16.11.6) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/compatibility-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/16.11.6/confidence-slim/14.17.32)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index a1a5ef25a91..e1dfcf360da 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^14.14.44", + "@types/node": "^16.0.0", "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", From b788cd1aafbf4f9580a04767bcec9c8493dfcc43 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:46:16 +0100 Subject: [PATCH 13/47] chore(deps): update dependency sinon to v12 (#15) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^11.0.0` -> `^12.0.0`](https://renovatebot.com/diffs/npm/sinon/11.1.2/12.0.1) | [![age](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/compatibility-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/12.0.1/confidence-slim/11.1.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v12.0.1`](https://togithub.com/sinonjs/sinon/blob/master/CHANGES.md#​1201) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v12.0.0...v12.0.1) - [`3f598221`](https://togithub.com/sinonjs/sinon/commit/3f598221045904681f2b3b3ba1df617ed5e230e3) Fix issue with npm unlink for npm version > 6 (Carl-Erik Kopseng) > 'npm unlink' would implicitly unlink the current dir > until version 7, which requires an argument - [`51417a38`](https://togithub.com/sinonjs/sinon/commit/51417a38111eeeb7cd14338bfb762cc2df487e1b) Fix bundling of cjs module ([#​2412](https://togithub.com/sinonjs/sinon/issues/2412)) (Julian Grinblat) > - Fix bundling of cjs module > > - Run prettier *Released by [Carl-Erik Kopseng](https://togithub.com/fatso83) on 2021-11-04.* #### 12.0.0 ### [`v12.0.0`](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v11.1.2...v12.0.0)
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index e1dfcf360da..5a507988d41 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^11.0.0", + "sinon": "^12.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From 98c185ecf687dc04d58e8f5f27e814a099754273 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 11 Nov 2021 16:12:50 -0800 Subject: [PATCH 14/47] docs(samples): add example tags to generated samples (#16) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add example tags to generated samples PiperOrigin-RevId: 408439482 Source-Link: https://github.com/googleapis/googleapis/commit/b9f61843dc80c7c285fc34fd3a40aae55082c2b9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb888bc214efc7bf43bf4634b470254565a659a5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../linkinator.config.json | 6 +- .../v1/data_fusion.create_instance.js | 6 +- .../v1/data_fusion.delete_instance.js | 4 +- .../generated/v1/data_fusion.get_instance.js | 4 +- .../v1/data_fusion.list_available_versions.js | 6 +- .../v1/data_fusion.list_instances.js | 4 +- .../v1/data_fusion.restart_instance.js | 4 +- .../v1/data_fusion.update_instance.js | 8 +- .../v1beta1/data_fusion.add_dns_peering.js | 6 +- .../v1beta1/data_fusion.create_instance.js | 6 +- .../v1beta1/data_fusion.delete_instance.js | 4 +- .../v1beta1/data_fusion.get_instance.js | 4 +- .../data_fusion.list_available_versions.js | 6 +- .../v1beta1/data_fusion.list_dns_peerings.js | 4 +- .../v1beta1/data_fusion.list_instances.js | 4 +- .../v1beta1/data_fusion.list_namespaces.js | 6 +- .../v1beta1/data_fusion.remove_dns_peering.js | 4 +- .../v1beta1/data_fusion.remove_iam_policy.js | 4 +- .../v1beta1/data_fusion.restart_instance.js | 4 +- .../v1beta1/data_fusion.update_instance.js | 8 +- .../v1beta1/data_fusion.upgrade_instance.js | 4 +- .../src/v1/data_fusion_client.ts | 394 +++++----- .../src/v1beta1/data_fusion_client.ts | 714 +++++++++--------- 23 files changed, 576 insertions(+), 638 deletions(-) diff --git a/packages/google-cloud-datafusion/linkinator.config.json b/packages/google-cloud-datafusion/linkinator.config.json index bf52b718fc7..0121dfa684f 100644 --- a/packages/google-cloud-datafusion/linkinator.config.json +++ b/packages/google-cloud-datafusion/linkinator.config.json @@ -3,10 +3,8 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io", - "https://www.npmjs.org/package/@google-cloud/data-fusion", - "https://github.com/googleapis/nodejs-data-fusion/blob/addSamplesAndTests/CHANGELOG.md" + "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js index febcb8ca704..7c04724d580 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -31,7 +31,7 @@ function main() { /** * An instance resource. */ - // const instance = '' + // const instance = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1; @@ -39,7 +39,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function createInstance() { + async function callCreateInstance() { // Construct request const request = {}; @@ -49,7 +49,7 @@ function main() { console.log(response); } - createInstance(); + callCreateInstance(); // [END datafusion_v1_generated_DataFusion_CreateInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js index ea460cdcfc8..e3e02c9a76f 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function deleteInstance() { + async function callDeleteInstance() { // Construct request const request = {}; @@ -41,7 +41,7 @@ function main() { console.log(response); } - deleteInstance(); + callDeleteInstance(); // [END datafusion_v1_generated_DataFusion_DeleteInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js index 11d044958b3..7abb7ec27c0 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function getInstance() { + async function callGetInstance() { // Construct request const request = {}; @@ -40,7 +40,7 @@ function main() { console.log(response); } - getInstance(); + callGetInstance(); // [END datafusion_v1_generated_DataFusion_GetInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js index f4a049b30cc..73b9822bf84 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -36,7 +36,7 @@ function main(parent) { /** * Whether or not to return the latest patch of every available minor version. * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 */ // const latestPatchOnly = true @@ -46,7 +46,7 @@ function main(parent) { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listAvailableVersions() { + async function callListAvailableVersions() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent) { } } - listAvailableVersions(); + callListAvailableVersions(); // [END datafusion_v1_generated_DataFusion_ListAvailableVersions_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js index 556953f8659..a39c242718a 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -50,7 +50,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listInstances() { + async function callListInstances() { // Construct request const request = {}; @@ -61,7 +61,7 @@ function main() { } } - listInstances(); + callListInstances(); // [END datafusion_v1_generated_DataFusion_ListInstances_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js index b8f4b51eac0..204166c7c5f 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function restartInstance() { + async function callRestartInstance() { // Construct request const request = {}; @@ -41,7 +41,7 @@ function main() { console.log(response); } - restartInstance(); + callRestartInstance(); // [END datafusion_v1_generated_DataFusion_RestartInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js index ea636f4ef59..86277581481 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js @@ -24,7 +24,7 @@ function main() { * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. */ - // const instance = '' + // const instance = {} /** * Field mask is used to specify the fields that the update will overwrite * in an instance resource. The fields specified in the update_mask are @@ -33,7 +33,7 @@ function main() { * If the user does not provide a mask, all the supported fields (labels, * options, and version currently) will be overwritten. */ - // const updateMask = '' + // const updateMask = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1; @@ -41,7 +41,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function updateInstance() { + async function callUpdateInstance() { // Construct request const request = {}; @@ -51,7 +51,7 @@ function main() { console.log(response); } - updateInstance(); + callUpdateInstance(); // [END datafusion_v1_generated_DataFusion_UpdateInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js index 30371c53967..a3cd40fc045 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -26,7 +26,7 @@ function main() { /** * Dns peering config. */ - // const dnsPeering = '' + // const dnsPeering = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; @@ -34,7 +34,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function addDnsPeering() { + async function callAddDnsPeering() { // Construct request const request = {}; @@ -43,7 +43,7 @@ function main() { console.log(response); } - addDnsPeering(); + callAddDnsPeering(); // [END datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js index db9c0eb689b..292d5389b53 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -31,7 +31,7 @@ function main() { /** * An instance resource. */ - // const instance = '' + // const instance = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; @@ -39,7 +39,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function createInstance() { + async function callCreateInstance() { // Construct request const request = {}; @@ -49,7 +49,7 @@ function main() { console.log(response); } - createInstance(); + callCreateInstance(); // [END datafusion_v1beta1_generated_DataFusion_CreateInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js index 06e53a7918b..29d72d2c0d7 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function deleteInstance() { + async function callDeleteInstance() { // Construct request const request = {}; @@ -41,7 +41,7 @@ function main() { console.log(response); } - deleteInstance(); + callDeleteInstance(); // [END datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js index 08350e450b8..ea79edef6ee 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function getInstance() { + async function callGetInstance() { // Construct request const request = {}; @@ -40,7 +40,7 @@ function main() { console.log(response); } - getInstance(); + callGetInstance(); // [END datafusion_v1beta1_generated_DataFusion_GetInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js index 2d9b3920049..eff837a37af 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -36,7 +36,7 @@ function main(parent) { /** * Whether or not to return the latest patch of every available minor version. * If true, only the latest patch will be returned. Ex. if allowed versions is - * [6.1.1, 6.1.2, 6.2.0] then response will be [6.1.2, 6.2.0] + * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 */ // const latestPatchOnly = true @@ -46,7 +46,7 @@ function main(parent) { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listAvailableVersions() { + async function callListAvailableVersions() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent) { } } - listAvailableVersions(); + callListAvailableVersions(); // [END datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js index 1f2c203b6ac..06d76095900 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js @@ -39,7 +39,7 @@ function main(parent) { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listDnsPeerings() { + async function callListDnsPeerings() { // Construct request const request = { parent, @@ -52,7 +52,7 @@ function main(parent) { } } - listDnsPeerings(); + callListDnsPeerings(); // [END datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js index 589504907ea..3fabc080f3c 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -50,7 +50,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listInstances() { + async function callListInstances() { // Construct request const request = {}; @@ -61,7 +61,7 @@ function main() { } } - listInstances(); + callListInstances(); // [END datafusion_v1beta1_generated_DataFusion_ListInstances_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js index dc5ec704b30..5192ea9c928 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -38,7 +38,7 @@ function main(parent) { * information associated with a namespace gets returned * (e.g. IAM policy set on the namespace) */ - // const view = '' + // const view = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; @@ -46,7 +46,7 @@ function main(parent) { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function listNamespaces() { + async function callListNamespaces() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent) { } } - listNamespaces(); + callListNamespaces(); // [END datafusion_v1beta1_generated_DataFusion_ListNamespaces_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js index 874382f8956..5d23edd24f3 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -34,7 +34,7 @@ function main(zone) { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function removeDnsPeering() { + async function callRemoveDnsPeering() { // Construct request const request = { zone, @@ -45,7 +45,7 @@ function main(zone) { console.log(response); } - removeDnsPeering(); + callRemoveDnsPeering(); // [END datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js index dba3b7dfad7..86b2c7a75a2 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -30,7 +30,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function removeIamPolicy() { + async function callRemoveIamPolicy() { // Construct request const request = {}; @@ -39,7 +39,7 @@ function main() { console.log(response); } - removeIamPolicy(); + callRemoveIamPolicy(); // [END datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js index e8faf24c80e..e4b3771cf2a 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -31,7 +31,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function restartInstance() { + async function callRestartInstance() { // Construct request const request = {}; @@ -41,7 +41,7 @@ function main() { console.log(response); } - restartInstance(); + callRestartInstance(); // [END datafusion_v1beta1_generated_DataFusion_RestartInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js index 529ffa9b8c3..9724f63d695 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js @@ -24,7 +24,7 @@ function main() { * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. */ - // const instance = '' + // const instance = {} /** * Field mask is used to specify the fields that the update will overwrite * in an instance resource. The fields specified in the update_mask are @@ -33,7 +33,7 @@ function main() { * If the user does not provide a mask, all the supported fields (labels and * options currently) will be overwritten. */ - // const updateMask = '' + // const updateMask = {} // Imports the Datafusion library const {DataFusionClient} = require('@google-cloud/data-fusion').v1beta1; @@ -41,7 +41,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function updateInstance() { + async function callUpdateInstance() { // Construct request const request = {}; @@ -51,7 +51,7 @@ function main() { console.log(response); } - updateInstance(); + callUpdateInstance(); // [END datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js index 1b1175ef58d..5794386c962 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -33,7 +33,7 @@ function main() { // Instantiates a client const datafusionClient = new DataFusionClient(); - async function upgradeInstance() { + async function callUpgradeInstance() { // Construct request const request = {}; @@ -43,7 +43,7 @@ function main() { console.log(response); } - upgradeInstance(); + callUpgradeInstance(); // [END datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] } diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index 00bee584faf..6d11d7336db 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -391,6 +391,24 @@ export class DataFusionClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1/data_fusion.get_instance.js + * region_tag:datafusion_v1_generated_DataFusion_GetInstance_async + */ getInstance( request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, options?: CallOptions @@ -418,24 +436,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1.Instance}. - * 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.getInstance(request); - */ getInstance( request?: protos.google.cloud.datafusion.v1.IGetInstanceRequest, optionsOrCallback?: @@ -478,6 +478,30 @@ export class DataFusionClient { return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * An instance resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_fusion.create_instance.js + * region_tag:datafusion_v1_generated_DataFusion_CreateInstance_async + */ createInstance( request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, options?: CallOptions @@ -514,31 +538,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ createInstance( request?: protos.google.cloud.datafusion.v1.ICreateInstanceRequest, optionsOrCallback?: @@ -596,11 +595,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/data_fusion.create_instance.js + * region_tag:datafusion_v1_generated_DataFusion_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -624,6 +620,26 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata >; } + /** + * Deletes a single Date Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_fusion.delete_instance.js + * region_tag:datafusion_v1_generated_DataFusion_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, options?: CallOptions @@ -660,27 +676,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Deletes a single Date Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ deleteInstance( request?: protos.google.cloud.datafusion.v1.IDeleteInstanceRequest, optionsOrCallback?: @@ -738,11 +733,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/data_fusion.delete_instance.js + * region_tag:datafusion_v1_generated_DataFusion_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -766,6 +758,34 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata >; } + /** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels, + * options, and version currently) will be overwritten. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_fusion.update_instance.js + * region_tag:datafusion_v1_generated_DataFusion_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, options?: CallOptions @@ -802,35 +822,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels, - * options, and version currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ updateInstance( request?: protos.google.cloud.datafusion.v1.IUpdateInstanceRequest, optionsOrCallback?: @@ -888,11 +879,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/data_fusion.update_instance.js + * region_tag:datafusion_v1_generated_DataFusion_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -916,6 +904,27 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata >; } + /** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/data_fusion.restart_instance.js + * region_tag:datafusion_v1_generated_DataFusion_RestartInstance_async + */ restartInstance( request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, options?: CallOptions @@ -952,28 +961,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ restartInstance( request?: protos.google.cloud.datafusion.v1.IRestartInstanceRequest, optionsOrCallback?: @@ -1031,11 +1018,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/data_fusion.restart_instance.js + * region_tag:datafusion_v1_generated_DataFusion_RestartInstance_async */ async checkRestartInstanceProgress( name: string @@ -1059,37 +1043,6 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata >; } - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.datafusion.v1.IVersion[], - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest | null, - protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - ] - >; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - | null - | undefined, - protos.google.cloud.datafusion.v1.IVersion - > - ): void; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, - | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse - | null - | undefined, - protos.google.cloud.datafusion.v1.IVersion - > - ): void; /** * Lists possible versions for Data Fusion instances in the specified project * and location. @@ -1121,6 +1074,37 @@ export class DataFusionClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1.IVersion[], + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + ] + >; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + > + ): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IVersion + > + ): void; listAvailableVersions( request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, optionsOrCallback?: @@ -1243,11 +1227,8 @@ export class DataFusionClient { * 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/data_fusion.list_available_versions.js + * region_tag:datafusion_v1_generated_DataFusion_ListAvailableVersions_async */ listAvailableVersionsAsync( request?: protos.google.cloud.datafusion.v1.IListAvailableVersionsRequest, @@ -1261,7 +1242,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1271,37 +1251,6 @@ export class DataFusionClient { callSettings ) as AsyncIterable; } - listInstances( - request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.datafusion.v1.IInstance[], - protos.google.cloud.datafusion.v1.IListInstancesRequest | null, - protos.google.cloud.datafusion.v1.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - | protos.google.cloud.datafusion.v1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.datafusion.v1.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.datafusion.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1.IListInstancesRequest, - | protos.google.cloud.datafusion.v1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.datafusion.v1.IInstance - > - ): void; /** * Lists Data Fusion instances in the specified project and location. * @@ -1334,6 +1283,37 @@ export class DataFusionClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1.IInstance[], + protos.google.cloud.datafusion.v1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.datafusion.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1.IInstance + > + ): void; listInstances( request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, optionsOrCallback?: @@ -1460,11 +1440,8 @@ export class DataFusionClient { * 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/data_fusion.list_instances.js + * region_tag:datafusion_v1_generated_DataFusion_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.datafusion.v1.IListInstancesRequest, @@ -1478,7 +1455,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index 48d48632e67..1638d645122 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -421,6 +421,24 @@ export class DataFusionClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets details of a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance}. + * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. + * 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/v1beta1/data_fusion.get_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_GetInstance_async + */ getInstance( request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, options?: CallOptions @@ -452,24 +470,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Gets details of a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance}. - * @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 [Instance]{@link google.cloud.datafusion.v1beta1.Instance}. - * 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.getInstance(request); - */ getInstance( request?: protos.google.cloud.datafusion.v1beta1.IGetInstanceRequest, optionsOrCallback?: @@ -513,6 +513,23 @@ export class DataFusionClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Remove IAM policy that is currently set on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.resource + * The resource on which IAM policy to be removed is attached to. + * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. + * 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/v1beta1/data_fusion.remove_iam_policy.js + * region_tag:datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async + */ removeIamPolicy( request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, options?: CallOptions @@ -547,23 +564,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Remove IAM policy that is currently set on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.resource - * The resource on which IAM policy to be removed is attached to. - * @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 [RemoveIamPolicyResponse]{@link google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse}. - * 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.removeIamPolicy(request); - */ removeIamPolicy( request?: protos.google.cloud.datafusion.v1beta1.IRemoveIamPolicyRequest, optionsOrCallback?: @@ -610,6 +610,25 @@ export class DataFusionClient { this.initialize(); return this.innerApiCalls.removeIamPolicy(request, options, callback); } + /** + * Add DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be created. + * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering + * Dns peering config. + * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. + * 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/v1beta1/data_fusion.add_dns_peering.js + * region_tag:datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async + */ addDnsPeering( request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, options?: CallOptions @@ -641,25 +660,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Add DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be created. - * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering - * Dns peering config. - * @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 [AddDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.AddDnsPeeringResponse}. - * 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.addDnsPeering(request); - */ addDnsPeering( request?: protos.google.cloud.datafusion.v1beta1.IAddDnsPeeringRequest, optionsOrCallback?: @@ -703,6 +703,25 @@ export class DataFusionClient { this.initialize(); return this.innerApiCalls.addDnsPeering(request, options, callback); } + /** + * Remove DNS peering on the given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The resource on which DNS peering will be removed. + * @param {string} request.zone + * Required. The zone to be removed. + * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. + * 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/v1beta1/data_fusion.remove_dns_peering.js + * region_tag:datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async + */ removeDnsPeering( request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, options?: CallOptions @@ -737,25 +756,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Remove DNS peering on the given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The resource on which DNS peering will be removed. - * @param {string} request.zone - * Required. The zone to be removed. - * @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 [RemoveDnsPeeringResponse]{@link google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse}. - * 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.removeDnsPeering(request); - */ removeDnsPeering( request?: protos.google.cloud.datafusion.v1beta1.IRemoveDnsPeeringRequest, optionsOrCallback?: @@ -803,6 +803,30 @@ export class DataFusionClient { return this.innerApiCalls.removeDnsPeering(request, options, callback); } + /** + * Creates a new Data Fusion instance in the specified project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * The instance's project and location in the format + * projects/{project}/locations/{location}. + * @param {string} request.instanceId + * The name of the instance to create. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * An instance resource. + * @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/v1beta1/data_fusion.create_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_CreateInstance_async + */ createInstance( request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, options?: CallOptions @@ -839,31 +863,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Creates a new Data Fusion instance in the specified project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * The instance's project and location in the format - * projects/{project}/locations/{location}. - * @param {string} request.instanceId - * The name of the instance to create. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * An instance resource. - * @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 - * const [operation] = await client.createInstance(request); - * const [response] = await operation.promise(); - */ createInstance( request?: protos.google.cloud.datafusion.v1beta1.ICreateInstanceRequest, optionsOrCallback?: @@ -921,11 +920,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkCreateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/data_fusion.create_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -949,6 +945,26 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata >; } + /** + * Deletes a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The instance resource name in the format + * projects/{project}/locations/{location}/instances/{instance} + * @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/v1beta1/data_fusion.delete_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, options?: CallOptions @@ -985,27 +1001,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Deletes a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The instance resource name in the format - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ deleteInstance( request?: protos.google.cloud.datafusion.v1beta1.IDeleteInstanceRequest, optionsOrCallback?: @@ -1063,11 +1058,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkDeleteInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/data_fusion.delete_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -1091,6 +1083,34 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata >; } + /** + * Updates a single Data Fusion instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.datafusion.v1beta1.Instance} request.instance + * The instance resource that replaces the resource on the server. Currently, + * Data Fusion only allows replacing labels, options, and stack driver + * settings. All other fields will be ignored. + * @param {google.protobuf.FieldMask} request.updateMask + * Field mask is used to specify the fields that the update will overwrite + * in an instance resource. 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, all the supported fields (labels and + * options currently) will be overwritten. + * @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/v1beta1/data_fusion.update_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, options?: CallOptions @@ -1127,35 +1147,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Updates a single Data Fusion instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, - * Data Fusion only allows replacing labels, options, and stack driver - * settings. All other fields will be ignored. - * @param {google.protobuf.FieldMask} request.updateMask - * Field mask is used to specify the fields that the update will overwrite - * in an instance resource. 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, all the supported fields (labels and - * options currently) will be overwritten. - * @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 - * const [operation] = await client.updateInstance(request); - * const [response] = await operation.promise(); - */ updateInstance( request?: protos.google.cloud.datafusion.v1beta1.IUpdateInstanceRequest, optionsOrCallback?: @@ -1213,11 +1204,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpdateInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/data_fusion.update_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -1241,6 +1229,27 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata >; } + /** + * Restart a single Data Fusion instance. + * At the end of an operation instance is fully restarted. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Name of the Data Fusion instance which need to be restarted in the form of + * projects/{project}/locations/{location}/instances/{instance} + * @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/v1beta1/data_fusion.restart_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_RestartInstance_async + */ restartInstance( request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, options?: CallOptions @@ -1277,28 +1286,6 @@ export class DataFusionClient { {} | null | undefined > ): void; - /** - * Restart a single Data Fusion instance. - * At the end of an operation instance is fully restarted. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of - * projects/{project}/locations/{location}/instances/{instance} - * @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 - * const [operation] = await client.restartInstance(request); - * const [response] = await operation.promise(); - */ restartInstance( request?: protos.google.cloud.datafusion.v1beta1.IRestartInstanceRequest, optionsOrCallback?: @@ -1356,11 +1343,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkRestartInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/data_fusion.restart_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_RestartInstance_async */ async checkRestartInstanceProgress( name: string @@ -1384,42 +1368,6 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata >; } - upgradeInstance( - request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options?: CallOptions - ): Promise< - [ - LROperation< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | undefined, - {} | undefined - ] - >; - upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - options: CallOptions, - callback: Callback< - LROperation< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; - upgradeInstance( - request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, - callback: Callback< - LROperation< - protos.google.cloud.datafusion.v1beta1.IInstance, - protos.google.cloud.datafusion.v1beta1.IOperationMetadata - >, - protos.google.longrunning.IOperation | null | undefined, - {} | null | undefined - > - ): void; /** * Upgrade a single Data Fusion instance. * At the end of an operation instance is fully upgraded. @@ -1440,10 +1388,45 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const [operation] = await client.upgradeInstance(request); - * const [response] = await operation.promise(); + * @example include:samples/generated/v1beta1/data_fusion.upgrade_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async */ + upgradeInstance( + request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + upgradeInstance( + request: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.datafusion.v1beta1.IInstance, + protos.google.cloud.datafusion.v1beta1.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; upgradeInstance( request?: protos.google.cloud.datafusion.v1beta1.IUpgradeInstanceRequest, optionsOrCallback?: @@ -1501,11 +1484,8 @@ export class DataFusionClient { * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) * for more details and examples. - * @example - * const decodedOperation = await checkUpgradeInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/data_fusion.upgrade_instance.js + * region_tag:datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async */ async checkUpgradeInstanceProgress( name: string @@ -1529,37 +1509,6 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata >; } - listAvailableVersions( - request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.datafusion.v1beta1.IVersion[], - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest | null, - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - ] - >; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - | null - | undefined, - protos.google.cloud.datafusion.v1beta1.IVersion - > - ): void; - listAvailableVersions( - request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, - | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse - | null - | undefined, - protos.google.cloud.datafusion.v1beta1.IVersion - > - ): void; /** * Lists possible versions for Data Fusion instances in the specified project * and location. @@ -1591,6 +1540,37 @@ export class DataFusionClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listAvailableVersions( + request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IVersion[], + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest | null, + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + ] + >; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + > + ): void; + listAvailableVersions( + request: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, + | protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IVersion + > + ): void; listAvailableVersions( request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, optionsOrCallback?: @@ -1713,11 +1693,8 @@ export class DataFusionClient { * 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.listAvailableVersionsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/data_fusion.list_available_versions.js + * region_tag:datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async */ listAvailableVersionsAsync( request?: protos.google.cloud.datafusion.v1beta1.IListAvailableVersionsRequest, @@ -1731,7 +1708,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1741,37 +1717,6 @@ export class DataFusionClient { callSettings ) as AsyncIterable; } - listInstances( - request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.datafusion.v1beta1.IInstance[], - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest | null, - protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.datafusion.v1beta1.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, - | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.datafusion.v1beta1.IInstance - > - ): void; /** * Lists Data Fusion instances in the specified project and location. * @@ -1804,6 +1749,37 @@ export class DataFusionClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.datafusion.v1beta1.IInstance[], + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest | null, + protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, + | protos.google.cloud.datafusion.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.datafusion.v1beta1.IInstance + > + ): void; listInstances( request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, optionsOrCallback?: @@ -1930,11 +1906,8 @@ export class DataFusionClient { * 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.listInstancesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/data_fusion.list_instances.js + * region_tag:datafusion_v1beta1_generated_DataFusion_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.datafusion.v1beta1.IListInstancesRequest, @@ -1948,7 +1921,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1958,6 +1930,36 @@ export class DataFusionClient { callSettings ) as AsyncIterable; } + /** + * List namespaces in a given instance + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance to list its namespaces. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view + * By default, only basic information about a namespace is returned + * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional + * information associated with a namespace gets returned + * (e.g. IAM policy set on the namespace) + * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. + * 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 `listNamespacesAsync()` + * 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. + */ listNamespaces( request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, options?: CallOptions @@ -1989,36 +1991,6 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.INamespace > ): void; - /** - * List namespaces in a given instance - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance to list its namespaces. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {google.cloud.datafusion.v1beta1.NamespaceView} request.view - * By default, only basic information about a namespace is returned - * (e.g. name). When `NAMESPACE_VIEW_FULL` is specified, additional - * information associated with a namespace gets returned - * (e.g. IAM policy set on the namespace) - * @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 [Namespace]{@link google.cloud.datafusion.v1beta1.Namespace}. - * 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 `listNamespacesAsync()` - * 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. - */ listNamespaces( request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, optionsOrCallback?: @@ -2141,11 +2113,8 @@ export class DataFusionClient { * 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.listNamespacesAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/data_fusion.list_namespaces.js + * region_tag:datafusion_v1beta1_generated_DataFusion_ListNamespaces_async */ listNamespacesAsync( request?: protos.google.cloud.datafusion.v1beta1.IListNamespacesRequest, @@ -2159,7 +2128,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listNamespaces']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -2169,6 +2137,31 @@ export class DataFusionClient { callSettings ) as AsyncIterable; } + /** + * List DNS peering for a given resource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The resource on which dns peering will be listed. + * @param {number} request.pageSize + * The maximum number of items to return. + * @param {string} request.pageToken + * The next_page_token value to use if there are additional + * results to retrieve for this list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. + * 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 `listDnsPeeringsAsync()` + * 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. + */ listDnsPeerings( request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, options?: CallOptions @@ -2200,31 +2193,6 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.IDnsPeering > ): void; - /** - * List DNS peering for a given resource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The resource on which dns peering will be listed. - * @param {number} request.pageSize - * The maximum number of items to return. - * @param {string} request.pageToken - * The next_page_token value to use if there are additional - * results to retrieve for this list request. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is Array of [DnsPeering]{@link google.cloud.datafusion.v1beta1.DnsPeering}. - * 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 `listDnsPeeringsAsync()` - * 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. - */ listDnsPeerings( request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, optionsOrCallback?: @@ -2337,11 +2305,8 @@ export class DataFusionClient { * 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.listDnsPeeringsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/data_fusion.list_dns_peerings.js + * region_tag:datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async */ listDnsPeeringsAsync( request?: protos.google.cloud.datafusion.v1beta1.IListDnsPeeringsRequest, @@ -2355,7 +2320,6 @@ export class DataFusionClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listDnsPeerings']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 81be7baec038c67735f653540116ec2a16ac3e32 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 10 Dec 2021 21:14:21 +0000 Subject: [PATCH 15/47] build: add generated samples to .eslintignore (#17) --- packages/google-cloud-datafusion/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-datafusion/.eslintignore b/packages/google-cloud-datafusion/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-datafusion/.eslintignore +++ b/packages/google-cloud-datafusion/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From 0694fb1de154b0eb305aa5b6d3c25c16d588da5d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Dec 2021 21:36:14 +0000 Subject: [PATCH 16/47] docs(node): support "stable"/"preview" release level (#1312) (#20) --- packages/google-cloud-datafusion/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index b19fa824ac2..36d9b6637f5 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -88,6 +88,7 @@ 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 @@ -96,6 +97,7 @@ 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 From b81ddf28c0d6e2212aa30ec3d9d9b23b25408a43 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 11:31:31 -0500 Subject: [PATCH 17/47] chore: add api_shortname and library_type to repo metadata (#19) --- packages/google-cloud-datafusion/.repo-metadata.json | 7 ++++--- packages/google-cloud-datafusion/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-datafusion/.repo-metadata.json b/packages/google-cloud-datafusion/.repo-metadata.json index 3bec0e20138..c580f1bfb06 100644 --- a/packages/google-cloud-datafusion/.repo-metadata.json +++ b/packages/google-cloud-datafusion/.repo-metadata.json @@ -4,12 +4,13 @@ "product_documentation": "https://cloud.google.com/data-fusion/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-fusion/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/5552618", - "release_level": "beta", + "release_level": "preview", "language": "nodejs", "repo": "googleapis/nodejs-data-fusion", "distribution_name": "@google-cloud/data-fusion", "api_id": "datafusion.googleapis.com", "default_version": "v1", - "requires_billing": true + "requires_billing": true, + "api_shortname": "datafusion", + "library_type": "GAPIC_AUTO" } - diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index 36d9b6637f5..cf93579cdfb 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -4,7 +4,7 @@ # [Cloud Data Fusion: Node.js Client](https://github.com/googleapis/nodejs-data-fusion) -[![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/data-fusion.svg)](https://www.npmjs.org/package/@google-cloud/data-fusion) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-fusion/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-fusion) @@ -89,13 +89,12 @@ 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. +This library is considered to be in **preview**. This means it is still a +work-in-progress and under active development. Any release is subject to +backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From cdcecb4734fa7ed2f884b7dc4722bff7c569248a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 30 Dec 2021 22:44:16 +0000 Subject: [PATCH 18/47] docs(badges): tweak badge to use new preview/stable language (#1314) (#22) --- packages/google-cloud-datafusion/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index cf93579cdfb..ac89bdf8533 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -4,9 +4,8 @@ # [Cloud Data Fusion: Node.js Client](https://github.com/googleapis/nodejs-data-fusion) - +[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/data-fusion.svg)](https://www.npmjs.org/package/@google-cloud/data-fusion) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-data-fusion/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-data-fusion) From 90a9bf408aea2b4680d1852cb07c9eb1d134caac Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 11 Jan 2022 17:18:42 +0000 Subject: [PATCH 19/47] test(nodejs): remove 15 add 16 (#1322) (#24) --- packages/google-cloud-datafusion/protos/protos.d.ts | 2 +- packages/google-cloud-datafusion/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index 64edfcf74ed..f61212155dc 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index 43b4caae23b..3744f93b498 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. From 45fe8f5690e8b1007e8e03c384a67958a9c77549 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 27 Jan 2022 16:31:03 +0000 Subject: [PATCH 20/47] chore: update v2.12.0 gapic-generator-typescript (#28) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 424244721 Source-Link: https://github.com/googleapis/googleapis/commit/4b6b01f507ebc3df95fdf8e1d76b0ae0ae33e52c Source-Link: https://github.com/googleapis/googleapis-gen/commit/8ac83fba606d008c7e8a42e7d55b6596ec4be35f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOGFjODNmYmE2MDZkMDA4YzdlOGE0MmU3ZDU1YjY1OTZlYzRiZTM1ZiJ9 --- packages/google-cloud-datafusion/.jsdoc.js | 4 +- .../linkinator.config.json | 10 +- .../cloud/datafusion/v1/datafusion.proto | 153 +++++++--- .../cloud/datafusion/v1beta1/v1beta1.proto | 205 +++++++++---- .../protos/protos.d.ts | 62 +++- .../google-cloud-datafusion/protos/protos.js | 276 ++++++++++++++++++ .../protos/protos.json | 193 ++++++++++-- .../v1/data_fusion.create_instance.js | 12 +- .../v1/data_fusion.delete_instance.js | 9 +- .../generated/v1/data_fusion.get_instance.js | 9 +- .../v1/data_fusion.list_available_versions.js | 9 +- .../v1/data_fusion.list_instances.js | 11 +- .../v1/data_fusion.restart_instance.js | 9 +- .../v1/data_fusion.update_instance.js | 9 +- .../v1beta1/data_fusion.add_dns_peering.js | 9 +- .../v1beta1/data_fusion.create_instance.js | 12 +- .../v1beta1/data_fusion.delete_instance.js | 9 +- .../v1beta1/data_fusion.get_instance.js | 9 +- .../data_fusion.list_available_versions.js | 9 +- .../v1beta1/data_fusion.list_dns_peerings.js | 3 +- .../v1beta1/data_fusion.list_instances.js | 11 +- .../v1beta1/data_fusion.list_namespaces.js | 3 +- .../v1beta1/data_fusion.remove_dns_peering.js | 6 +- .../v1beta1/data_fusion.remove_iam_policy.js | 9 +- .../v1beta1/data_fusion.restart_instance.js | 9 +- .../v1beta1/data_fusion.update_instance.js | 9 +- .../v1beta1/data_fusion.upgrade_instance.js | 9 +- .../src/v1/data_fusion_client.ts | 145 ++++++++- .../google-cloud-datafusion/src/v1/index.ts | 2 +- .../src/v1beta1/data_fusion_client.ts | 153 ++++++++-- .../src/v1beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- .../system-test/install.ts | 2 +- .../test/gapic_data_fusion_v1.ts | 127 +++++++- .../test/gapic_data_fusion_v1beta1.ts | 127 +++++++- 36 files changed, 1395 insertions(+), 245 deletions(-) diff --git a/packages/google-cloud-datafusion/.jsdoc.js b/packages/google-cloud-datafusion/.jsdoc.js index edfc037518e..72e8fd397a6 100644 --- a/packages/google-cloud-datafusion/.jsdoc.js +++ b/packages/google-cloud-datafusion/.jsdoc.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2021 Google LLC', + copyright: 'Copyright 2022 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/data-fusion', diff --git a/packages/google-cloud-datafusion/linkinator.config.json b/packages/google-cloud-datafusion/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-datafusion/linkinator.config.json +++ b/packages/google-cloud-datafusion/linkinator.config.json @@ -3,8 +3,14 @@ "skip": [ "https://codecov.io/gh/googleapis/", "www.googleapis.com", - "img.shields.io" + "img.shields.io", + "https://console.cloud.google.com/cloudshell", + "https://support.google.com" ], "silent": true, - "concurrency": 5 + "concurrency": 5, + "retry": true, + "retryErrors": true, + "retryErrorsCount": 5, + "retryErrorsJitter": 3000 } diff --git a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto index aae228337b8..6151050939a 100644 --- a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto +++ b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1/datafusion.proto @@ -30,19 +30,21 @@ option java_multiple_files = true; option java_package = "com.google.cloud.datafusion.v1"; option php_namespace = "Google\\Cloud\\DataFusion\\V1"; option ruby_package = "Google::Cloud::DataFusion::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; // Service for creating and managing Data Fusion instances. // Data Fusion enables ETL developers to build code-free, data integration // pipelines via a point-and-click UI. service DataFusion { option (google.api.default_host) = "datafusion.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists possible versions for Data Fusion instances in the specified project // and location. - rpc ListAvailableVersions(ListAvailableVersionsRequest) - returns (ListAvailableVersionsResponse) { + rpc ListAvailableVersions(ListAvailableVersionsRequest) returns (ListAvailableVersionsResponse) { option (google.api.http) = { get: "/v1/{parent=projects/*/locations/*}/versions" }; @@ -64,8 +66,7 @@ service DataFusion { } // Creates a new Data Fusion instance in the specified project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{parent=projects/*/locations/*}/instances" body: "instance" @@ -78,8 +79,7 @@ service DataFusion { } // Deletes a single Date Fusion instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1/{name=projects/*/locations/*/instances/*}" }; @@ -91,8 +91,7 @@ service DataFusion { } // Updates a single Data Fusion instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" body: "instance" @@ -106,8 +105,7 @@ service DataFusion { // Restart a single Data Fusion instance. // At the end of an operation instance is fully restarted. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { + rpc RestartInstance(RestartInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/instances/*}:restart" body: "*" @@ -141,6 +139,18 @@ message NetworkConfig { // The Data Fusion version. This proto message stores information about certain // Data Fusion version, which is used for Data Fusion version upgrade. message Version { + // Each type represents the release availability of a CDF version + enum Type { + // Version does not have availability yet + TYPE_UNSPECIFIED = 0; + + // Version is under development and not considered stable + TYPE_PREVIEW = 1; + + // Version is available for public use + TYPE_GENERAL_AVAILABILITY = 2; + } + // The version number of the Data Fusion instance, such as '6.0.1.0'. string version_number = 1; @@ -149,6 +159,9 @@ message Version { // Represents a list of available feature names for a given version. repeated string available_features = 3; + + // Type represents the release availability of the version + Type type = 4; } // Identifies Data Fusion accelerators for an instance. @@ -201,7 +214,9 @@ message CryptoKeyConfig { // The name of the key which is used to encrypt/decrypt customer data. For key // in Cloud KMS, the key should be in the format of // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string key_reference = 1; + string key_reference = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Represents a Data Fusion instance. @@ -267,11 +282,28 @@ message Instance { // Instance is being auto-upgraded AUTO_UPGRADING = 9; + + // Instance is disabled + DISABLED = 10; + } + + // The reason for disabling the instance if the state is DISABLED. + enum DisabledReason { + // This is an unknown reason for disabling. + DISABLED_REASON_UNSPECIFIED = 0; + + // The KMS key used by the instance is either revoked or denied access to + KMS_KEY_ISSUE = 1; } // Output only. The name of this instance is in the form of // projects/{project}/locations/{location}/instances/{instance}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; // A description of this instance. string description = 2; @@ -304,12 +336,10 @@ message Instance { map options = 9; // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the instance was last updated. - google.protobuf.Timestamp update_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current state of this Data Fusion instance. State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -328,10 +358,11 @@ message Instance { // Current version of the Data Fusion. Only specifiable in Update. string version = 16; - // Output only. Deprecated. Use tenant_project_id instead to extract the - // tenant project ID. - string service_account = 17 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Deprecated. Use tenant_project_id instead to extract the tenant project ID. + string service_account = 17 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; // Display name for an instance. string display_name = 18; @@ -343,8 +374,7 @@ message Instance { // Output only. Endpoint on which the REST APIs is accessible. string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Cloud Storage bucket generated by Data Fusion in the customer - // project. + // Output only. Cloud Storage bucket generated by Data Fusion in the customer project. string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; // List of accelerators enabled for this CDF instance. @@ -369,15 +399,23 @@ message Instance { // The crypto key configuration. This field is used by the Customer-Managed // Encryption Keys (CMEK) feature. CryptoKeyConfig crypto_key_config = 28; + + // Output only. If the instance state is DISABLED, the reason for disabling the instance. + repeated DisabledReason disabled_reason = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for listing Data Fusion instances. message ListInstancesRequest { - // The project and location for which to retrieve instance information + // Required. The project and location for which to retrieve instance information // in the format projects/{project}/locations/{location}. If the location is // specified as '-' (wildcard), then all regions available to the project // are queried, and the results are aggregated. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // The maximum number of items to return. int32 page_size = 2; @@ -408,9 +446,14 @@ message ListInstancesResponse { // Request message for the list available versions request. message ListAvailableVersionsRequest { - // Required. The project and location for which to retrieve instance - // information in the format projects/{project}/locations/{location}. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + // Required. The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // The maximum number of items to return. int32 page_size = 2; @@ -437,19 +480,29 @@ message ListAvailableVersionsResponse { // Request message for getting details about a Data Fusion instance. message GetInstanceRequest { - // The instance resource name in the format + // Required. The instance resource name in the format // projects/{project}/locations/{location}/instances/{instance}. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Request message for creating a Data Fusion instance. message CreateInstanceRequest { - // The instance's project and location in the format + // Required. The instance's project and location in the format // projects/{project}/locations/{location}. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; - // The name of the instance to create. - string instance_id = 2; + // Required. The name of the instance to create. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; // An instance resource. Instance instance = 3; @@ -457,16 +510,24 @@ message CreateInstanceRequest { // Request message for deleting a Data Fusion instance. message DeleteInstanceRequest { - // The instance resource name in the format + // Required. The instance resource name in the format // projects/{project}/locations/{location}/instances/{instance} - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } +// Request message for updating a Data Fusion instance. +// Data Fusion allows updating the labels, options, and stack driver settings. +// This is also used for CDF version upgrade. message UpdateInstanceRequest { - // The instance resource that replaces the resource on the server. Currently, + // Required. The instance resource that replaces the resource on the server. Currently, // Data Fusion only allows replacing labels, options, and stack driver // settings. All other fields will be ignored. - Instance instance = 1; + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; // Field mask is used to specify the fields that the update will overwrite // in an instance resource. The fields specified in the update_mask are @@ -479,9 +540,14 @@ message UpdateInstanceRequest { // Request message for restarting a Data Fusion instance. message RestartInstanceRequest { - // Name of the Data Fusion instance which need to be restarted in the form of + // Required. Name of the Data Fusion instance which need to be restarted in the form of // projects/{project}/locations/{location}/instances/{instance} - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Represents the metadata of a long-running operation. @@ -503,9 +569,8 @@ message OperationMetadata { // Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6; // API version used to start the operation. diff --git a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto index d3f9565f92d..ac3f309c1ea 100644 --- a/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto +++ b/packages/google-cloud-datafusion/protos/google/cloud/datafusion/v1beta1/v1beta1.proto @@ -32,19 +32,21 @@ option java_multiple_files = true; option java_package = "com.google.cloud.datafusion.v1beta1"; option php_namespace = "Google\\Cloud\\DataFusion\\V1beta1"; option ruby_package = "Google::Cloud::DataFusion::V1beta1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" +}; // Service for creating and managing Data Fusion instances. // Data Fusion enables ETL developers to build code-free, data integration // pipelines via a point-and-click UI. service DataFusion { option (google.api.default_host) = "datafusion.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; // Lists possible versions for Data Fusion instances in the specified project // and location. - rpc ListAvailableVersions(ListAvailableVersionsRequest) - returns (ListAvailableVersionsResponse) { + rpc ListAvailableVersions(ListAvailableVersionsRequest) returns (ListAvailableVersionsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*}/versions" }; @@ -66,8 +68,7 @@ service DataFusion { } // Creates a new Data Fusion instance in the specified project and location. - rpc CreateInstance(CreateInstanceRequest) - returns (google.longrunning.Operation) { + rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*}/instances" body: "instance" @@ -80,8 +81,7 @@ service DataFusion { } // Deletes a single Data Fusion instance. - rpc DeleteInstance(DeleteInstanceRequest) - returns (google.longrunning.Operation) { + rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" }; @@ -93,8 +93,7 @@ service DataFusion { } // Updates a single Data Fusion instance. - rpc UpdateInstance(UpdateInstanceRequest) - returns (google.longrunning.Operation) { + rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" body: "instance" @@ -108,8 +107,7 @@ service DataFusion { // Restart a single Data Fusion instance. // At the end of an operation instance is fully restarted. - rpc RestartInstance(RestartInstanceRequest) - returns (google.longrunning.Operation) { + rpc RestartInstance(RestartInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restart" body: "*" @@ -122,8 +120,7 @@ service DataFusion { // Upgrade a single Data Fusion instance. // At the end of an operation instance is fully upgraded. - rpc UpgradeInstance(UpgradeInstanceRequest) - returns (google.longrunning.Operation) { + rpc UpgradeInstance(UpgradeInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1beta1/{name=projects/*/locations/*/instances/*}:upgrade" body: "*" @@ -135,8 +132,7 @@ service DataFusion { } // Remove IAM policy that is currently set on the given resource. - rpc RemoveIamPolicy(RemoveIamPolicyRequest) - returns (RemoveIamPolicyResponse) { + rpc RemoveIamPolicy(RemoveIamPolicyRequest) returns (RemoveIamPolicyResponse) { option (google.api.http) = { post: "/v1beta1/{resource=projects/*/locations/*/**}:removeIamPolicy" body: "*" @@ -161,8 +157,7 @@ service DataFusion { } // Remove DNS peering on the given resource. - rpc RemoveDnsPeering(RemoveDnsPeeringRequest) - returns (RemoveDnsPeeringResponse) { + rpc RemoveDnsPeering(RemoveDnsPeeringRequest) returns (RemoveDnsPeeringResponse) { option (google.api.http) = { post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:remove" body: "*" @@ -171,8 +166,7 @@ service DataFusion { } // List DNS peering for a given resource. - rpc ListDnsPeerings(ListDnsPeeringsRequest) - returns (ListDnsPeeringsResponse) { + rpc ListDnsPeerings(ListDnsPeeringsRequest) returns (ListDnsPeeringsResponse) { option (google.api.http) = { get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/dnsPeerings:list" }; @@ -201,6 +195,18 @@ message NetworkConfig { // The Data Fusion version. message Version { + // Each type represents the release availability of a CDF version + enum Type { + // Version does not have availability yet + TYPE_UNSPECIFIED = 0; + + // Version is under development and not considered stable + TYPE_PREVIEW = 1; + + // Version is available for public use + TYPE_GENERAL_AVAILABILITY = 2; + } + // The version number of the Data Fusion instance, such as '6.0.1.0'. string version_number = 1; @@ -209,6 +215,9 @@ message Version { // Represents a list of available feature names for a given version. repeated string available_features = 3; + + // Type represents the release availability of the version + Type type = 4; } // Identifies Data Fusion accelerators for an instance. @@ -237,7 +246,9 @@ message CryptoKeyConfig { // The name of the key which is used to encrypt/decrypt customer data. For key // in Cloud KMS, the key should be in the format of // `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string key_reference = 1; + string key_reference = 1 [(google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + }]; } // Represents a Data Fusion instance. @@ -302,11 +313,28 @@ message Instance { // Instance is being auto-upgraded AUTO_UPGRADING = 9; + + // Instance is disabled + DISABLED = 10; + } + + // The reason for disabling the instance if the state is DISABLED. + enum DisabledReason { + // This is an unknown reason for disabling. + DISABLED_REASON_UNSPECIFIED = 0; + + // The KMS key used by the instance is either revoked or denied access to + KMS_KEY_ISSUE = 1; } // Output only. The name of this instance is in the form of // projects/{project}/locations/{location}/instances/{instance}. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; // A description of this instance. string description = 2; @@ -339,12 +367,10 @@ message Instance { map options = 9; // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time the instance was last updated. - google.protobuf.Timestamp update_time = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp update_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The current state of this Data Fusion instance. State state = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -363,10 +389,11 @@ message Instance { // Current version of Data Fusion. string version = 16; - // Output only. Deprecated. Use tenant_project_id instead to extract the - // tenant project ID. - string service_account = 17 - [deprecated = true, (google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. Deprecated. Use tenant_project_id instead to extract the tenant project ID. + string service_account = 17 [ + deprecated = true, + (google.api.field_behavior) = OUTPUT_ONLY + ]; // Display name for an instance. string display_name = 18; @@ -378,8 +405,7 @@ message Instance { // Output only. Endpoint on which the REST APIs is accessible. string api_endpoint = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Cloud Storage bucket generated by Data Fusion in the customer - // project. + // Output only. Cloud Storage bucket generated by Data Fusion in the customer project. string gcs_bucket = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; // List of accelerators enabled for this CDF instance. @@ -404,15 +430,23 @@ message Instance { // The crypto key configuration. This field is used by the Customer-Managed // Encryption Keys (CMEK) feature. CryptoKeyConfig crypto_key_config = 27; + + // Output only. If the instance state is DISABLED, the reason for disabling the instance. + repeated DisabledReason disabled_reason = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; } // Request message for listing Data Fusion instances. message ListInstancesRequest { - // The project and location for which to retrieve instance information + // Required. The project and location for which to retrieve instance information // in the format projects/{project}/locations/{location}. If the location is // specified as '-' (wildcard), then all regions available to the project // are queried, and the results are aggregated. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // The maximum number of items to return. int32 page_size = 2; @@ -443,9 +477,14 @@ message ListInstancesResponse { // Request message for the list available versions request. message ListAvailableVersionsRequest { - // Required. The project and location for which to retrieve instance - // information in the format projects/{project}/locations/{location}. - string parent = 1 [(google.api.field_behavior) = REQUIRED]; + // Required. The project and location for which to retrieve instance information + // in the format projects/{project}/locations/{location}. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; // The maximum number of items to return. int32 page_size = 2; @@ -472,19 +511,29 @@ message ListAvailableVersionsResponse { // Request message for getting details about a Data Fusion instance. message GetInstanceRequest { - // The instance resource name in the format + // Required. The instance resource name in the format // projects/{project}/locations/{location}/instances/{instance}. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Request message for creating a Data Fusion instance. message CreateInstanceRequest { - // The instance's project and location in the format + // Required. The instance's project and location in the format // projects/{project}/locations/{location}. - string parent = 1; + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; - // The name of the instance to create. - string instance_id = 2; + // Required. The name of the instance to create. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; // An instance resource. Instance instance = 3; @@ -492,19 +541,24 @@ message CreateInstanceRequest { // Request message for deleting a Data Fusion instance. message DeleteInstanceRequest { - // The instance resource name in the format + // Required. The instance resource name in the format // projects/{project}/locations/{location}/instances/{instance} - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Request message for updating a Data Fusion instance. // Data Fusion only allows updating the labels, options, and stack driver // settings. message UpdateInstanceRequest { - // The instance resource that replaces the resource on the server. Currently, + // Required. The instance resource that replaces the resource on the server. Currently, // Data Fusion only allows replacing labels, options, and stack driver // settings. All other fields will be ignored. - Instance instance = 1; + Instance instance = 1 [(google.api.field_behavior) = REQUIRED]; // Field mask is used to specify the fields that the update will overwrite // in an instance resource. The fields specified in the update_mask are @@ -517,19 +571,29 @@ message UpdateInstanceRequest { // Request message for restarting a Data Fusion instance. message RestartInstanceRequest { - // Name of the Data Fusion instance which need to be restarted in the form of + // Required. Name of the Data Fusion instance which need to be restarted in the form of // projects/{project}/locations/{location}/instances/{instance} - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Request message for upgrading a Data Fusion instance. // To change the instance properties, instance update should be used. message UpgradeInstanceRequest { - // Name of the Data Fusion instance which need to be upgraded in the form of + // Required. Name of the Data Fusion instance which need to be upgraded in the form of // projects/{project}/locations/{location}/instances/{instance} // Instance will be upgraded with the latest stable version of the Data // Fusion. - string name = 1; + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; } // Represents the metadata of a long-running operation. @@ -551,9 +615,8 @@ message OperationMetadata { // Identifies whether the user has requested cancellation // of the operation. Operations that have successfully been cancelled - // have [Operation.error][] value with a - // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to - // `Code.CANCELLED`. + // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to `Code.CANCELLED`. bool requested_cancellation = 6; // API version used to start the operation. @@ -562,12 +625,14 @@ message OperationMetadata { // Request message for RemoveIamPolicy method. message RemoveIamPolicyRequest { - // The resource on which IAM policy to be removed is attached to. - string resource = 1; + // Required. The resource on which IAM policy to be removed is attached to. + string resource = 1 [(google.api.field_behavior) = REQUIRED]; } // Response message for RemoveIamPolicy method. -message RemoveIamPolicyResponse {} +message RemoveIamPolicyResponse { + +} // List namespaces request. message ListNamespacesRequest { @@ -649,15 +714,22 @@ message DnsPeering { // Request message to create dns peering. message AddDnsPeeringRequest { - // The resource on which DNS peering will be created. - string parent = 1; + // Required. The resource on which DNS peering will be created. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; // Dns peering config. DnsPeering dns_peering = 2; } // Response message for set dns peering method. -message AddDnsPeeringResponse {} +message AddDnsPeeringResponse { + +} // A view for Namespace enum NamespaceView { @@ -673,15 +745,22 @@ enum NamespaceView { // Request message to remove dns peering. message RemoveDnsPeeringRequest { - // The resource on which DNS peering will be removed. - string parent = 1; + // Required. The resource on which DNS peering will be removed. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "datafusion.googleapis.com/Instance" + } + ]; // Required. The zone to be removed. string zone = 2 [(google.api.field_behavior) = REQUIRED]; } // Response message for set dns peering method. -message RemoveDnsPeeringResponse {} +message RemoveDnsPeeringResponse { + +} // List dns peering request. message ListDnsPeeringsRequest { diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index f61212155dc..ae3b110c741 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -304,6 +304,9 @@ export namespace google { /** Version availableFeatures */ availableFeatures?: (string[]|null); + + /** Version type */ + type?: (google.cloud.datafusion.v1.Version.Type|keyof typeof google.cloud.datafusion.v1.Version.Type|null); } /** Represents a Version. */ @@ -324,6 +327,9 @@ export namespace google { /** Version availableFeatures. */ public availableFeatures: string[]; + /** Version type. */ + public type: (google.cloud.datafusion.v1.Version.Type|keyof typeof google.cloud.datafusion.v1.Version.Type); + /** * Creates a new Version instance using the specified properties. * @param [properties] Properties to set @@ -395,6 +401,16 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace Version { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TYPE_PREVIEW = 1, + TYPE_GENERAL_AVAILABILITY = 2 + } + } + /** Properties of an Accelerator. */ interface IAccelerator { @@ -683,6 +699,9 @@ export namespace google { /** Instance cryptoKeyConfig */ cryptoKeyConfig?: (google.cloud.datafusion.v1.ICryptoKeyConfig|null); + + /** Instance disabledReason */ + disabledReason?: (google.cloud.datafusion.v1.Instance.DisabledReason[]|null); } /** Represents an Instance. */ @@ -775,6 +794,9 @@ export namespace google { /** Instance cryptoKeyConfig. */ public cryptoKeyConfig?: (google.cloud.datafusion.v1.ICryptoKeyConfig|null); + /** Instance disabledReason. */ + public disabledReason: google.cloud.datafusion.v1.Instance.DisabledReason[]; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -867,7 +889,14 @@ export namespace google { RESTARTING = 6, UPDATING = 7, AUTO_UPDATING = 8, - AUTO_UPGRADING = 9 + AUTO_UPGRADING = 9, + DISABLED = 10 + } + + /** DisabledReason enum. */ + enum DisabledReason { + DISABLED_REASON_UNSPECIFIED = 0, + KMS_KEY_ISSUE = 1 } } @@ -2299,6 +2328,9 @@ export namespace google { /** Version availableFeatures */ availableFeatures?: (string[]|null); + + /** Version type */ + type?: (google.cloud.datafusion.v1beta1.Version.Type|keyof typeof google.cloud.datafusion.v1beta1.Version.Type|null); } /** Represents a Version. */ @@ -2319,6 +2351,9 @@ export namespace google { /** Version availableFeatures. */ public availableFeatures: string[]; + /** Version type. */ + public type: (google.cloud.datafusion.v1beta1.Version.Type|keyof typeof google.cloud.datafusion.v1beta1.Version.Type); + /** * Creates a new Version instance using the specified properties. * @param [properties] Properties to set @@ -2390,6 +2425,16 @@ export namespace google { public toJSON(): { [k: string]: any }; } + namespace Version { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + TYPE_PREVIEW = 1, + TYPE_GENERAL_AVAILABILITY = 2 + } + } + /** Properties of an Accelerator. */ interface IAccelerator { @@ -2663,6 +2708,9 @@ export namespace google { /** Instance cryptoKeyConfig */ cryptoKeyConfig?: (google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null); + + /** Instance disabledReason */ + disabledReason?: (google.cloud.datafusion.v1beta1.Instance.DisabledReason[]|null); } /** Represents an Instance. */ @@ -2755,6 +2803,9 @@ export namespace google { /** Instance cryptoKeyConfig. */ public cryptoKeyConfig?: (google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null); + /** Instance disabledReason. */ + public disabledReason: google.cloud.datafusion.v1beta1.Instance.DisabledReason[]; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -2847,7 +2898,14 @@ export namespace google { RESTARTING = 6, UPDATING = 7, AUTO_UPDATING = 8, - AUTO_UPGRADING = 9 + AUTO_UPGRADING = 9, + DISABLED = 10 + } + + /** DisabledReason enum. */ + enum DisabledReason { + DISABLED_REASON_UNSPECIFIED = 0, + KMS_KEY_ISSUE = 1 } } diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index 3744f93b498..a83d3f6da30 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -551,6 +551,7 @@ * @property {string|null} [versionNumber] Version versionNumber * @property {boolean|null} [defaultVersion] Version defaultVersion * @property {Array.|null} [availableFeatures] Version availableFeatures + * @property {google.cloud.datafusion.v1.Version.Type|null} [type] Version type */ /** @@ -593,6 +594,14 @@ */ Version.prototype.availableFeatures = $util.emptyArray; + /** + * Version type. + * @member {google.cloud.datafusion.v1.Version.Type} type + * @memberof google.cloud.datafusion.v1.Version + * @instance + */ + Version.prototype.type = 0; + /** * Creates a new Version instance using the specified properties. * @function create @@ -624,6 +633,8 @@ if (message.availableFeatures != null && message.availableFeatures.length) for (var i = 0; i < message.availableFeatures.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableFeatures[i]); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); return writer; }; @@ -669,6 +680,9 @@ message.availableFeatures = []; message.availableFeatures.push(reader.string()); break; + case 4: + message.type = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -717,6 +731,15 @@ if (!$util.isString(message.availableFeatures[i])) return "availableFeatures: string[] expected"; } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -743,6 +766,20 @@ for (var i = 0; i < object.availableFeatures.length; ++i) message.availableFeatures[i] = String(object.availableFeatures[i]); } + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PREVIEW": + case 1: + message.type = 1; + break; + case "TYPE_GENERAL_AVAILABILITY": + case 2: + message.type = 2; + break; + } return message; }; @@ -764,6 +801,7 @@ if (options.defaults) { object.versionNumber = ""; object.defaultVersion = false; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; } if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) object.versionNumber = message.versionNumber; @@ -774,6 +812,8 @@ for (var j = 0; j < message.availableFeatures.length; ++j) object.availableFeatures[j] = message.availableFeatures[j]; } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Version.Type[message.type] : message.type; return object; }; @@ -788,6 +828,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Type enum. + * @name google.cloud.datafusion.v1.Version.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TYPE_PREVIEW=1 TYPE_PREVIEW value + * @property {number} TYPE_GENERAL_AVAILABILITY=2 TYPE_GENERAL_AVAILABILITY value + */ + Version.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_PREVIEW"] = 1; + values[valuesById[2] = "TYPE_GENERAL_AVAILABILITY"] = 2; + return values; + })(); + return Version; })(); @@ -1303,6 +1359,7 @@ * @property {string|null} [dataprocServiceAccount] Instance dataprocServiceAccount * @property {boolean|null} [enableRbac] Instance enableRbac * @property {google.cloud.datafusion.v1.ICryptoKeyConfig|null} [cryptoKeyConfig] Instance cryptoKeyConfig + * @property {Array.|null} [disabledReason] Instance disabledReason */ /** @@ -1318,6 +1375,7 @@ this.options = {}; this.availableVersion = []; this.accelerators = []; + this.disabledReason = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1540,6 +1598,14 @@ */ Instance.prototype.cryptoKeyConfig = null; + /** + * Instance disabledReason. + * @member {Array.} disabledReason + * @memberof google.cloud.datafusion.v1.Instance + * @instance + */ + Instance.prototype.disabledReason = $util.emptyArray; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -1622,6 +1688,12 @@ writer.uint32(/* id 27, wireType 0 =*/216).bool(message.enableRbac); if (message.cryptoKeyConfig != null && Object.hasOwnProperty.call(message, "cryptoKeyConfig")) $root.google.cloud.datafusion.v1.CryptoKeyConfig.encode(message.cryptoKeyConfig, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.disabledReason != null && message.disabledReason.length) { + writer.uint32(/* id 29, wireType 2 =*/234).fork(); + for (var i = 0; i < message.disabledReason.length; ++i) + writer.int32(message.disabledReason[i]); + writer.ldelim(); + } return writer; }; @@ -1779,6 +1851,16 @@ case 28: message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.decode(reader, reader.uint32()); break; + case 29: + if (!(message.disabledReason && message.disabledReason.length)) + message.disabledReason = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.disabledReason.push(reader.int32()); + } else + message.disabledReason.push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -1884,6 +1966,7 @@ case 7: case 8: case 9: + case 10: break; } if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) @@ -1945,6 +2028,18 @@ if (error) return "cryptoKeyConfig." + error; } + if (message.disabledReason != null && message.hasOwnProperty("disabledReason")) { + if (!Array.isArray(message.disabledReason)) + return "disabledReason: array expected"; + for (var i = 0; i < message.disabledReason.length; ++i) + switch (message.disabledReason[i]) { + default: + return "disabledReason: enum value[] expected"; + case 0: + case 1: + break; + } + } return null; }; @@ -2058,6 +2153,10 @@ case 9: message.state = 9; break; + case "DISABLED": + case 10: + message.state = 10; + break; } if (object.stateMessage != null) message.stateMessage = String(object.stateMessage); @@ -2108,6 +2207,23 @@ throw TypeError(".google.cloud.datafusion.v1.Instance.cryptoKeyConfig: object expected"); message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.fromObject(object.cryptoKeyConfig); } + if (object.disabledReason) { + if (!Array.isArray(object.disabledReason)) + throw TypeError(".google.cloud.datafusion.v1.Instance.disabledReason: array expected"); + message.disabledReason = []; + for (var i = 0; i < object.disabledReason.length; ++i) + switch (object.disabledReason[i]) { + default: + case "DISABLED_REASON_UNSPECIFIED": + case 0: + message.disabledReason[i] = 0; + break; + case "KMS_KEY_ISSUE": + case 1: + message.disabledReason[i] = 1; + break; + } + } return message; }; @@ -2127,6 +2243,7 @@ if (options.arrays || options.defaults) { object.availableVersion = []; object.accelerators = []; + object.disabledReason = []; } if (options.objects || options.defaults) { object.labels = {}; @@ -2224,6 +2341,11 @@ object.enableRbac = message.enableRbac; if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) object.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.toObject(message.cryptoKeyConfig, options); + if (message.disabledReason && message.disabledReason.length) { + object.disabledReason = []; + for (var j = 0; j < message.disabledReason.length; ++j) + object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; + } return object; }; @@ -2270,6 +2392,7 @@ * @property {number} UPDATING=7 UPDATING value * @property {number} AUTO_UPDATING=8 AUTO_UPDATING value * @property {number} AUTO_UPGRADING=9 AUTO_UPGRADING value + * @property {number} DISABLED=10 DISABLED value */ Instance.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -2283,6 +2406,21 @@ values[valuesById[7] = "UPDATING"] = 7; values[valuesById[8] = "AUTO_UPDATING"] = 8; values[valuesById[9] = "AUTO_UPGRADING"] = 9; + values[valuesById[10] = "DISABLED"] = 10; + return values; + })(); + + /** + * DisabledReason enum. + * @name google.cloud.datafusion.v1.Instance.DisabledReason + * @enum {number} + * @property {number} DISABLED_REASON_UNSPECIFIED=0 DISABLED_REASON_UNSPECIFIED value + * @property {number} KMS_KEY_ISSUE=1 KMS_KEY_ISSUE value + */ + Instance.DisabledReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISABLED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_ISSUE"] = 1; return values; })(); @@ -5421,6 +5559,7 @@ * @property {string|null} [versionNumber] Version versionNumber * @property {boolean|null} [defaultVersion] Version defaultVersion * @property {Array.|null} [availableFeatures] Version availableFeatures + * @property {google.cloud.datafusion.v1beta1.Version.Type|null} [type] Version type */ /** @@ -5463,6 +5602,14 @@ */ Version.prototype.availableFeatures = $util.emptyArray; + /** + * Version type. + * @member {google.cloud.datafusion.v1beta1.Version.Type} type + * @memberof google.cloud.datafusion.v1beta1.Version + * @instance + */ + Version.prototype.type = 0; + /** * Creates a new Version instance using the specified properties. * @function create @@ -5494,6 +5641,8 @@ if (message.availableFeatures != null && message.availableFeatures.length) for (var i = 0; i < message.availableFeatures.length; ++i) writer.uint32(/* id 3, wireType 2 =*/26).string(message.availableFeatures[i]); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.type); return writer; }; @@ -5539,6 +5688,9 @@ message.availableFeatures = []; message.availableFeatures.push(reader.string()); break; + case 4: + message.type = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -5587,6 +5739,15 @@ if (!$util.isString(message.availableFeatures[i])) return "availableFeatures: string[] expected"; } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -5613,6 +5774,20 @@ for (var i = 0; i < object.availableFeatures.length; ++i) message.availableFeatures[i] = String(object.availableFeatures[i]); } + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "TYPE_PREVIEW": + case 1: + message.type = 1; + break; + case "TYPE_GENERAL_AVAILABILITY": + case 2: + message.type = 2; + break; + } return message; }; @@ -5634,6 +5809,7 @@ if (options.defaults) { object.versionNumber = ""; object.defaultVersion = false; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; } if (message.versionNumber != null && message.hasOwnProperty("versionNumber")) object.versionNumber = message.versionNumber; @@ -5644,6 +5820,8 @@ for (var j = 0; j < message.availableFeatures.length; ++j) object.availableFeatures[j] = message.availableFeatures[j]; } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Version.Type[message.type] : message.type; return object; }; @@ -5658,6 +5836,22 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Type enum. + * @name google.cloud.datafusion.v1beta1.Version.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} TYPE_PREVIEW=1 TYPE_PREVIEW value + * @property {number} TYPE_GENERAL_AVAILABILITY=2 TYPE_GENERAL_AVAILABILITY value + */ + Version.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TYPE_PREVIEW"] = 1; + values[valuesById[2] = "TYPE_GENERAL_AVAILABILITY"] = 2; + return values; + })(); + return Version; })(); @@ -6102,6 +6296,7 @@ * @property {string|null} [dataprocServiceAccount] Instance dataprocServiceAccount * @property {boolean|null} [enableRbac] Instance enableRbac * @property {google.cloud.datafusion.v1beta1.ICryptoKeyConfig|null} [cryptoKeyConfig] Instance cryptoKeyConfig + * @property {Array.|null} [disabledReason] Instance disabledReason */ /** @@ -6117,6 +6312,7 @@ this.options = {}; this.availableVersion = []; this.accelerators = []; + this.disabledReason = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6339,6 +6535,14 @@ */ Instance.prototype.cryptoKeyConfig = null; + /** + * Instance disabledReason. + * @member {Array.} disabledReason + * @memberof google.cloud.datafusion.v1beta1.Instance + * @instance + */ + Instance.prototype.disabledReason = $util.emptyArray; + /** * Creates a new Instance instance using the specified properties. * @function create @@ -6421,6 +6625,12 @@ writer.uint32(/* id 26, wireType 0 =*/208).bool(message.enableRbac); if (message.cryptoKeyConfig != null && Object.hasOwnProperty.call(message, "cryptoKeyConfig")) $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.encode(message.cryptoKeyConfig, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.disabledReason != null && message.disabledReason.length) { + writer.uint32(/* id 28, wireType 2 =*/226).fork(); + for (var i = 0; i < message.disabledReason.length; ++i) + writer.int32(message.disabledReason[i]); + writer.ldelim(); + } return writer; }; @@ -6578,6 +6788,16 @@ case 27: message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.decode(reader, reader.uint32()); break; + case 28: + if (!(message.disabledReason && message.disabledReason.length)) + message.disabledReason = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.disabledReason.push(reader.int32()); + } else + message.disabledReason.push(reader.int32()); + break; default: reader.skipType(tag & 7); break; @@ -6683,6 +6903,7 @@ case 7: case 8: case 9: + case 10: break; } if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) @@ -6744,6 +6965,18 @@ if (error) return "cryptoKeyConfig." + error; } + if (message.disabledReason != null && message.hasOwnProperty("disabledReason")) { + if (!Array.isArray(message.disabledReason)) + return "disabledReason: array expected"; + for (var i = 0; i < message.disabledReason.length; ++i) + switch (message.disabledReason[i]) { + default: + return "disabledReason: enum value[] expected"; + case 0: + case 1: + break; + } + } return null; }; @@ -6857,6 +7090,10 @@ case 9: message.state = 9; break; + case "DISABLED": + case 10: + message.state = 10; + break; } if (object.stateMessage != null) message.stateMessage = String(object.stateMessage); @@ -6907,6 +7144,23 @@ throw TypeError(".google.cloud.datafusion.v1beta1.Instance.cryptoKeyConfig: object expected"); message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.fromObject(object.cryptoKeyConfig); } + if (object.disabledReason) { + if (!Array.isArray(object.disabledReason)) + throw TypeError(".google.cloud.datafusion.v1beta1.Instance.disabledReason: array expected"); + message.disabledReason = []; + for (var i = 0; i < object.disabledReason.length; ++i) + switch (object.disabledReason[i]) { + default: + case "DISABLED_REASON_UNSPECIFIED": + case 0: + message.disabledReason[i] = 0; + break; + case "KMS_KEY_ISSUE": + case 1: + message.disabledReason[i] = 1; + break; + } + } return message; }; @@ -6926,6 +7180,7 @@ if (options.arrays || options.defaults) { object.availableVersion = []; object.accelerators = []; + object.disabledReason = []; } if (options.objects || options.defaults) { object.labels = {}; @@ -7023,6 +7278,11 @@ object.enableRbac = message.enableRbac; if (message.cryptoKeyConfig != null && message.hasOwnProperty("cryptoKeyConfig")) object.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.toObject(message.cryptoKeyConfig, options); + if (message.disabledReason && message.disabledReason.length) { + object.disabledReason = []; + for (var j = 0; j < message.disabledReason.length; ++j) + object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; + } return object; }; @@ -7069,6 +7329,7 @@ * @property {number} UPDATING=7 UPDATING value * @property {number} AUTO_UPDATING=8 AUTO_UPDATING value * @property {number} AUTO_UPGRADING=9 AUTO_UPGRADING value + * @property {number} DISABLED=10 DISABLED value */ Instance.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7082,6 +7343,21 @@ values[valuesById[7] = "UPDATING"] = 7; values[valuesById[8] = "AUTO_UPDATING"] = 8; values[valuesById[9] = "AUTO_UPGRADING"] = 9; + values[valuesById[10] = "DISABLED"] = 10; + return values; + })(); + + /** + * DisabledReason enum. + * @name google.cloud.datafusion.v1beta1.Instance.DisabledReason + * @enum {number} + * @property {number} DISABLED_REASON_UNSPECIFIED=0 DISABLED_REASON_UNSPECIFIED value + * @property {number} KMS_KEY_ISSUE=1 KMS_KEY_ISSUE value + */ + Instance.DisabledReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISABLED_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_ISSUE"] = 1; return values; })(); diff --git a/packages/google-cloud-datafusion/protos/protos.json b/packages/google-cloud-datafusion/protos/protos.json index 8f08eed1b0c..8391a877591 100644 --- a/packages/google-cloud-datafusion/protos/protos.json +++ b/packages/google-cloud-datafusion/protos/protos.json @@ -13,7 +13,9 @@ "java_multiple_files": true, "java_package": "com.google.cloud.datafusion.v1", "php_namespace": "Google\\Cloud\\DataFusion\\V1", - "ruby_package": "Google::Cloud::DataFusion::V1" + "ruby_package": "Google::Cloud::DataFusion::V1", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" }, "nested": { "DataFusion": { @@ -202,6 +204,19 @@ "rule": "repeated", "type": "string", "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TYPE_PREVIEW": 1, + "TYPE_GENERAL_AVAILABILITY": 2 + } } } }, @@ -239,7 +254,10 @@ "fields": { "keyReference": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } } }, @@ -253,7 +271,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" } }, "description": { @@ -397,6 +416,14 @@ "cryptoKeyConfig": { "type": "CryptoKeyConfig", "id": 28 + }, + "disabledReason": { + "rule": "repeated", + "type": "DisabledReason", + "id": 29, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -419,7 +446,14 @@ "RESTARTING": 6, "UPDATING": 7, "AUTO_UPDATING": 8, - "AUTO_UPGRADING": 9 + "AUTO_UPGRADING": 9, + "DISABLED": 10 + } + }, + "DisabledReason": { + "values": { + "DISABLED_REASON_UNSPECIFIED": 0, + "KMS_KEY_ISSUE": 1 } } } @@ -428,7 +462,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "pageSize": { "type": "int32", @@ -472,7 +510,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" } }, "pageSize": { @@ -506,7 +545,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -514,11 +557,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "instanceId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "instance": { "type": "Instance", @@ -530,7 +580,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -538,7 +592,10 @@ "fields": { "instance": { "type": "Instance", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -550,7 +607,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -600,7 +661,9 @@ "java_multiple_files": true, "java_package": "com.google.cloud.datafusion.v1beta1", "php_namespace": "Google\\Cloud\\DataFusion\\V1beta1", - "ruby_package": "Google::Cloud::DataFusion::V1beta1" + "ruby_package": "Google::Cloud::DataFusion::V1beta1", + "(google.api.resource_definition).type": "cloudkms.googleapis.com/CryptoKey", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}" }, "nested": { "DataFusion": { @@ -905,6 +968,19 @@ "rule": "repeated", "type": "string", "id": 3 + }, + "type": { + "type": "Type", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "TYPE_PREVIEW": 1, + "TYPE_GENERAL_AVAILABILITY": 2 + } } } }, @@ -929,7 +1005,10 @@ "fields": { "keyReference": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey" + } } } }, @@ -943,7 +1022,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" } }, "description": { @@ -1087,6 +1167,14 @@ "cryptoKeyConfig": { "type": "CryptoKeyConfig", "id": 27 + }, + "disabledReason": { + "rule": "repeated", + "type": "DisabledReason", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } }, "nested": { @@ -1109,7 +1197,14 @@ "RESTARTING": 6, "UPDATING": 7, "AUTO_UPDATING": 8, - "AUTO_UPGRADING": 9 + "AUTO_UPGRADING": 9, + "DISABLED": 10 + } + }, + "DisabledReason": { + "values": { + "DISABLED_REASON_UNSPECIFIED": 0, + "KMS_KEY_ISSUE": 1 } } } @@ -1118,7 +1213,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "pageSize": { "type": "int32", @@ -1162,7 +1261,8 @@ "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" } }, "pageSize": { @@ -1196,7 +1296,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -1204,11 +1308,18 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } }, "instanceId": { "type": "string", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "instance": { "type": "Instance", @@ -1220,7 +1331,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -1228,7 +1343,10 @@ "fields": { "instance": { "type": "Instance", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, "updateMask": { "type": "google.protobuf.FieldMask", @@ -1240,7 +1358,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -1248,7 +1370,11 @@ "fields": { "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } } } }, @@ -1288,7 +1414,10 @@ "fields": { "resource": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, @@ -1403,7 +1532,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } }, "dnsPeering": { "type": "DnsPeering", @@ -1425,7 +1558,11 @@ "fields": { "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "datafusion.googleapis.com/Instance" + } }, "zone": { "type": "string", diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js index 7c04724d580..a87168b9272 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -12,20 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(parent, instanceId) { // [START datafusion_v1_generated_DataFusion_CreateInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance's project and location in the format + * Required. The instance's project and location in the format * projects/{project}/locations/{location}. */ // const parent = 'abc123' /** - * The name of the instance to create. + * Required. The name of the instance to create. */ // const instanceId = 'abc123' /** @@ -41,7 +42,10 @@ function main() { async function callCreateInstance() { // Construct request - const request = {}; + const request = { + parent, + instanceId, + }; // Run request const [operation] = await datafusionClient.createInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js index e3e02c9a76f..272f76ce6d7 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1_generated_DataFusion_DeleteInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance} */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callDeleteInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const [operation] = await datafusionClient.deleteInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js index 7abb7ec27c0..b9b04157a55 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1_generated_DataFusion_GetInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance}. */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callGetInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const response = await datafusionClient.getInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js index 73b9822bf84..2f64d8cdc61 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -20,8 +21,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. */ // const parent = 'abc123' /** @@ -36,7 +37,7 @@ function main(parent) { /** * Whether or not to return the latest patch of every available minor version. * If true, only the latest patch will be returned. Ex. if allowed versions is - * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 + * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 */ // const latestPatchOnly = true @@ -55,7 +56,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listAvailableVersionsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js index a39c242718a..383e0555903 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(parent) { // [START datafusion_v1_generated_DataFusion_ListInstances_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -52,12 +53,14 @@ function main() { async function callListInstances() { // Construct request - const request = {}; + const request = { + parent, + }; // Run request const iterable = await datafusionClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js index 204166c7c5f..9bc181c6c80 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1_generated_DataFusion_RestartInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * Name of the Data Fusion instance which need to be restarted in the form of + * Required. Name of the Data Fusion instance which need to be restarted in the form of * projects/{project}/locations/{location}/instances/{instance} */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callRestartInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const [operation] = await datafusionClient.restartInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js index 86277581481..f0119a119dc 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(instance) { // [START datafusion_v1_generated_DataFusion_UpdateInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource that replaces the resource on the server. Currently, + * Required. The instance resource that replaces the resource on the server. Currently, * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. */ @@ -43,7 +44,9 @@ function main() { async function callUpdateInstance() { // Construct request - const request = {}; + const request = { + instance, + }; // Run request const [operation] = await datafusionClient.updateInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js index a3cd40fc045..a0186a964c1 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The resource on which DNS peering will be created. + * Required. The resource on which DNS peering will be created. */ // const parent = 'abc123' /** @@ -36,7 +37,9 @@ function main() { async function callAddDnsPeering() { // Construct request - const request = {}; + const request = { + parent, + }; // Run request const response = await datafusionClient.addDnsPeering(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js index 292d5389b53..830428d8c83 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -12,20 +12,21 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(parent, instanceId) { // [START datafusion_v1beta1_generated_DataFusion_CreateInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance's project and location in the format + * Required. The instance's project and location in the format * projects/{project}/locations/{location}. */ // const parent = 'abc123' /** - * The name of the instance to create. + * Required. The name of the instance to create. */ // const instanceId = 'abc123' /** @@ -41,7 +42,10 @@ function main() { async function callCreateInstance() { // Construct request - const request = {}; + const request = { + parent, + instanceId, + }; // Run request const [operation] = await datafusionClient.createInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js index 29d72d2c0d7..874c55ae1b9 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1beta1_generated_DataFusion_DeleteInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance} */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callDeleteInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const [operation] = await datafusionClient.deleteInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js index ea79edef6ee..f82845fbc3b 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1beta1_generated_DataFusion_GetInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance}. */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callGetInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const response = await datafusionClient.getInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js index eff837a37af..c4732e5abe1 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -20,8 +21,8 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. */ // const parent = 'abc123' /** @@ -36,7 +37,7 @@ function main(parent) { /** * Whether or not to return the latest patch of every available minor version. * If true, only the latest patch will be returned. Ex. if allowed versions is - * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 + * 6.1.1, 6.1.2, 6.2.0 then response will be 6.1.2, 6.2.0 */ // const latestPatchOnly = true @@ -55,7 +56,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listAvailableVersionsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js index 06d76095900..8983978ad9a 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -48,7 +49,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listDnsPeeringsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js index 3fabc080f3c..5c02845d9da 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_ListInstances_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -52,12 +53,14 @@ function main() { async function callListInstances() { // Construct request - const request = {}; + const request = { + parent, + }; // Run request const iterable = await datafusionClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js index 5192ea9c928..0e8e7bb1212 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -55,7 +56,7 @@ function main(parent) { // Run request const iterable = await datafusionClient.listNamespacesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js index 5d23edd24f3..d7a5e09ba2e 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main(zone) { +function main(parent, zone) { // [START datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The resource on which DNS peering will be removed. + * Required. The resource on which DNS peering will be removed. */ // const parent = 'abc123' /** @@ -37,6 +38,7 @@ function main(zone) { async function callRemoveDnsPeering() { // Construct request const request = { + parent, zone, }; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js index 86b2c7a75a2..bf1c14b9200 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(resource) { // [START datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The resource on which IAM policy to be removed is attached to. + * Required. The resource on which IAM policy to be removed is attached to. */ // const resource = 'abc123' @@ -32,7 +33,9 @@ function main() { async function callRemoveIamPolicy() { // Construct request - const request = {}; + const request = { + resource, + }; // Run request const response = await datafusionClient.removeIamPolicy(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js index e4b3771cf2a..b7c7520f043 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1beta1_generated_DataFusion_RestartInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * Name of the Data Fusion instance which need to be restarted in the form of + * Required. Name of the Data Fusion instance which need to be restarted in the form of * projects/{project}/locations/{location}/instances/{instance} */ // const name = 'abc123' @@ -33,7 +34,9 @@ function main() { async function callRestartInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const [operation] = await datafusionClient.restartInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js index 9724f63d695..771ea845e22 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(instance) { // [START datafusion_v1beta1_generated_DataFusion_UpdateInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * The instance resource that replaces the resource on the server. Currently, + * Required. The instance resource that replaces the resource on the server. Currently, * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. */ @@ -43,7 +44,9 @@ function main() { async function callUpdateInstance() { // Construct request - const request = {}; + const request = { + instance, + }; // Run request const [operation] = await datafusionClient.updateInstance(request); diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js index 5794386c962..2d7156c2ca7 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -12,15 +12,16 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; -function main() { +function main(name) { // [START datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async] /** * TODO(developer): Uncomment these variables before running the sample. */ /** - * Name of the Data Fusion instance which need to be upgraded in the form of + * Required. Name of the Data Fusion instance which need to be upgraded in the form of * projects/{project}/locations/{location}/instances/{instance} * Instance will be upgraded with the latest stable version of the Data * Fusion. @@ -35,7 +36,9 @@ function main() { async function callUpgradeInstance() { // Construct request - const request = {}; + const request = { + name, + }; // Run request const [operation] = await datafusionClient.upgradeInstance(request); diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index 6d11d7336db..8a237af3c6d 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -168,9 +168,15 @@ export class DataFusionClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), instancePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), }; // Some of the methods on this service return "paged" results, @@ -397,7 +403,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance}. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -484,10 +490,10 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The instance's project and location in the format + * Required. The instance's project and location in the format * projects/{project}/locations/{location}. * @param {string} request.instanceId - * The name of the instance to create. + * Required. The name of the instance to create. * @param {google.cloud.datafusion.v1.Instance} request.instance * An instance resource. * @param {object} [options] @@ -626,7 +632,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance} * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -764,7 +770,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.datafusion.v1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, + * Required. The instance resource that replaces the resource on the server. Currently, * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. * @param {google.protobuf.FieldMask} request.updateMask @@ -911,7 +917,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of + * Required. Name of the Data Fusion instance which need to be restarted in the form of * projects/{project}/locations/{location}/instances/{instance} * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1050,8 +1056,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1154,8 +1160,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1206,8 +1212,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1257,7 +1263,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -1363,7 +1369,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -1417,7 +1423,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -1468,6 +1474,77 @@ export class DataFusionClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .crypto_key; + } + /** * Return a fully-qualified instance resource name string. * @@ -1517,6 +1594,42 @@ export class DataFusionClient { return this.pathTemplates.instancePathTemplate.match(instanceName).instance; } + /** + * 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; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-datafusion/src/v1/index.ts b/packages/google-cloud-datafusion/src/v1/index.ts index 6dd78dbfb06..4acc645290e 100644 --- a/packages/google-cloud-datafusion/src/v1/index.ts +++ b/packages/google-cloud-datafusion/src/v1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index 1638d645122..dd084a4e0fd 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -168,9 +168,15 @@ export class DataFusionClient { // identifiers to uniquely identify resources within the API. // Create useful helper objects for these. this.pathTemplates = { + cryptoKeyPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}' + ), instancePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}' ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), namespacePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}/namespaces/{namespace}' ), @@ -427,7 +433,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance}. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -519,7 +525,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.resource - * The resource on which IAM policy to be removed is attached to. + * Required. The resource on which IAM policy to be removed is attached to. * @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. @@ -616,7 +622,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The resource on which DNS peering will be created. + * Required. The resource on which DNS peering will be created. * @param {google.cloud.datafusion.v1beta1.DnsPeering} request.dnsPeering * Dns peering config. * @param {object} [options] @@ -709,7 +715,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The resource on which DNS peering will be removed. + * Required. The resource on which DNS peering will be removed. * @param {string} request.zone * Required. The zone to be removed. * @param {object} [options] @@ -809,10 +815,10 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The instance's project and location in the format + * Required. The instance's project and location in the format * projects/{project}/locations/{location}. * @param {string} request.instanceId - * The name of the instance to create. + * Required. The name of the instance to create. * @param {google.cloud.datafusion.v1beta1.Instance} request.instance * An instance resource. * @param {object} [options] @@ -951,7 +957,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * The instance resource name in the format + * Required. The instance resource name in the format * projects/{project}/locations/{location}/instances/{instance} * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1089,7 +1095,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.datafusion.v1beta1.Instance} request.instance - * The instance resource that replaces the resource on the server. Currently, + * Required. The instance resource that replaces the resource on the server. Currently, * Data Fusion only allows replacing labels, options, and stack driver * settings. All other fields will be ignored. * @param {google.protobuf.FieldMask} request.updateMask @@ -1236,7 +1242,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the Data Fusion instance which need to be restarted in the form of + * Required. Name of the Data Fusion instance which need to be restarted in the form of * projects/{project}/locations/{location}/instances/{instance} * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. @@ -1375,7 +1381,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Name of the Data Fusion instance which need to be upgraded in the form of + * Required. Name of the Data Fusion instance which need to be upgraded in the form of * projects/{project}/locations/{location}/instances/{instance} * Instance will be upgraded with the latest stable version of the Data * Fusion. @@ -1516,8 +1522,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1620,8 +1626,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1672,8 +1678,8 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve instance - * information in the format projects/{project}/locations/{location}. + * Required. The project and location for which to retrieve instance information + * in the format projects/{project}/locations/{location}. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1723,7 +1729,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -1829,7 +1835,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -1883,7 +1889,7 @@ export class DataFusionClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * The project and location for which to retrieve instance information + * Required. The project and location for which to retrieve instance information * in the format projects/{project}/locations/{location}. If the location is * specified as '-' (wildcard), then all regions available to the project * are queried, and the results are aggregated. @@ -2333,6 +2339,77 @@ export class DataFusionClient { // -- Path templates -- // -------------------- + /** + * Return a fully-qualified cryptoKey resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} key_ring + * @param {string} crypto_key + * @returns {string} Resource name string. + */ + cryptoKeyPath( + project: string, + location: string, + keyRing: string, + cryptoKey: string + ) { + return this.pathTemplates.cryptoKeyPathTemplate.render({ + project: project, + location: location, + key_ring: keyRing, + crypto_key: cryptoKey, + }); + } + + /** + * Parse the project from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the project. + */ + matchProjectFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .project; + } + + /** + * Parse the location from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the location. + */ + matchLocationFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .location; + } + + /** + * Parse the key_ring from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the key_ring. + */ + matchKeyRingFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .key_ring; + } + + /** + * Parse the crypto_key from CryptoKey resource. + * + * @param {string} cryptoKeyName + * A fully-qualified path representing CryptoKey resource. + * @returns {string} A string representing the crypto_key. + */ + matchCryptoKeyFromCryptoKeyName(cryptoKeyName: string) { + return this.pathTemplates.cryptoKeyPathTemplate.match(cryptoKeyName) + .crypto_key; + } + /** * Return a fully-qualified instance resource name string. * @@ -2382,6 +2459,42 @@ export class DataFusionClient { return this.pathTemplates.instancePathTemplate.match(instanceName).instance; } + /** + * 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 namespace resource name string. * diff --git a/packages/google-cloud-datafusion/src/v1beta1/index.ts b/packages/google-cloud-datafusion/src/v1beta1/index.ts index 6dd78dbfb06..4acc645290e 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/index.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js index 9962a7c2cd0..1b580a94d81 100644 --- a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.js @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts index 997c1111df2..384129b7075 100644 --- a/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-datafusion/system-test/fixtures/sample/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/system-test/install.ts b/packages/google-cloud-datafusion/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-datafusion/system-test/install.ts +++ b/packages/google-cloud-datafusion/system-test/install.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index f86f7143cc0..3cd249d7542 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -1695,6 +1695,82 @@ describe('v1.DataFusionClient', () => { }); describe('Path templates', () => { + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + key_ring: 'keyRingValue', + crypto_key: 'cryptoKeyValue', + }; + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyRingValue', + 'cryptoKeyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyRingValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'cryptoKeyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('instance', () => { const fakePath = '/rendered/path/instance'; const expectedParameters = { @@ -1758,5 +1834,54 @@ describe('v1.DataFusionClient', () => { ); }); }); + + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new datafusionModule.v1.DataFusionClient({ + 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) + ); + }); + }); }); }); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index 9b66e7c7a88..af70ce784ba 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -1,4 +1,4 @@ -// Copyright 2021 Google LLC +// 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. @@ -2888,6 +2888,82 @@ describe('v1beta1.DataFusionClient', () => { }); describe('Path templates', () => { + describe('cryptoKey', () => { + const fakePath = '/rendered/path/cryptoKey'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + key_ring: 'keyRingValue', + crypto_key: 'cryptoKeyValue', + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.cryptoKeyPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.cryptoKeyPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('cryptoKeyPath', () => { + const result = client.cryptoKeyPath( + 'projectValue', + 'locationValue', + 'keyRingValue', + 'cryptoKeyValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromCryptoKeyName', () => { + const result = client.matchProjectFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromCryptoKeyName', () => { + const result = client.matchLocationFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKeyRingFromCryptoKeyName', () => { + const result = client.matchKeyRingFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'keyRingValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCryptoKeyFromCryptoKeyName', () => { + const result = client.matchCryptoKeyFromCryptoKeyName(fakePath); + assert.strictEqual(result, 'cryptoKeyValue'); + assert( + (client.pathTemplates.cryptoKeyPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('instance', () => { const fakePath = '/rendered/path/instance'; const expectedParameters = { @@ -2952,6 +3028,55 @@ describe('v1beta1.DataFusionClient', () => { }); }); + describe('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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('namespace', () => { const fakePath = '/rendered/path/namespace'; const expectedParameters = { From 66989c4e31f0ef5958fadb94f3e7241a672d7ea6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Feb 2022 23:37:31 +0100 Subject: [PATCH 21/47] chore(deps): update dependency sinon to v13 (#30) --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 5a507988d41..eddd1bf0448 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^12.0.0", + "sinon": "^13.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From bdd501cae612bd674370057d25762f08f9f5d0ff Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 22:06:37 +0000 Subject: [PATCH 22/47] docs(nodejs): version support policy edits (#1346) (#32) --- packages/google-cloud-datafusion/README.md | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index ac89bdf8533..12669085407 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -65,21 +65,21 @@ also contains samples. 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. -Client libraries targeting some end-of-life versions of Node.js are available, and -can be installed via npm [dist-tags](https://docs.npmjs.com/cli/dist-tag). -The dist-tags follow the naming convention `legacy-(version)`. - -_Legacy Node.js versions are supported as a best effort:_ +Google's client libraries support legacy versions of Node.js runtimes on a +best-efforts basis with the following warnings: -* Legacy versions will not be tested in continuous integration. -* Some security patches may not be able to be backported. -* Dependencies will not be kept up-to-date, and features will not be backported. +* Legacy versions are not tested in continuous integration. +* Some security patches and features cannot be backported. +* Dependencies cannot be kept up-to-date. -#### Legacy tags available - -* `legacy-8`: install client libraries from this dist-tag for versions - compatible with Node.js 8. +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/data-fusion@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 71c9c40833727ccffac3e223a3b3f35e3f8502e8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 18 Feb 2022 02:06:43 +0000 Subject: [PATCH 23/47] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#33) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 429395631 Source-Link: https://github.com/googleapis/googleapis/commit/84594b35af0c38efcd6967e8179d801702ad96ff Source-Link: https://github.com/googleapis/googleapis-gen/commit/ed74f970fd82914874e6b27b04763cfa66bafe9b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9 --- .../v1/data_fusion.create_instance.js | 9 +- .../v1/data_fusion.delete_instance.js | 9 +- .../generated/v1/data_fusion.get_instance.js | 9 +- .../v1/data_fusion.list_available_versions.js | 9 +- .../v1/data_fusion.list_instances.js | 9 +- .../v1/data_fusion.restart_instance.js | 9 +- .../v1/data_fusion.update_instance.js | 9 +- ...t_metadata.google.cloud.datafusion.v1.json | 335 ++++++++++ .../v1beta1/data_fusion.add_dns_peering.js | 9 +- .../v1beta1/data_fusion.create_instance.js | 9 +- .../v1beta1/data_fusion.delete_instance.js | 9 +- .../v1beta1/data_fusion.get_instance.js | 9 +- .../data_fusion.list_available_versions.js | 9 +- .../v1beta1/data_fusion.list_dns_peerings.js | 9 +- .../v1beta1/data_fusion.list_instances.js | 9 +- .../v1beta1/data_fusion.list_namespaces.js | 9 +- .../v1beta1/data_fusion.remove_dns_peering.js | 9 +- .../v1beta1/data_fusion.remove_iam_policy.js | 9 +- .../v1beta1/data_fusion.restart_instance.js | 9 +- .../v1beta1/data_fusion.update_instance.js | 9 +- .../v1beta1/data_fusion.upgrade_instance.js | 9 +- ...adata.google.cloud.datafusion.v1beta1.json | 603 ++++++++++++++++++ .../src/v1/data_fusion_client.ts | 5 +- .../src/v1beta1/data_fusion_client.ts | 5 +- .../test/gapic_data_fusion_v1.ts | 35 +- .../test/gapic_data_fusion_v1beta1.ts | 83 ++- 26 files changed, 1196 insertions(+), 50 deletions(-) create mode 100644 packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json create mode 100644 packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js index a87168b9272..350d73e4deb 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js index 272f76ce6d7..54b492907c8 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js index b9b04157a55..69aab354dab 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js index 2f64d8cdc61..79f75c58502 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js index 383e0555903..1647a8df78e 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js index 9bc181c6c80..30a39b15f30 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js index f0119a119dc..ffe8de3c0c2 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json new file mode 100644 index 00000000000..b7faba8996a --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -0,0 +1,335 @@ +{ + "clientLibrary": { + "name": "nodejs-datafusion", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.datafusion.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "datafusion_v1_generated_DataFusion_ListAvailableVersions_async", + "title": "DataFusion listAvailableVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists possible versions for Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_available_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "latest_patch_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.datafusion.v1.ListAvailableVersionsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_ListInstances_async", + "title": "DataFusion listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", + "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.datafusion.v1.ListInstancesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_GetInstance_async", + "title": "DataFusion getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1.Instance", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_CreateInstance_async", + "title": "DataFusion createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Data Fusion instance in the specified project and location.", + "canonical": true, + "file": "data_fusion.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.datafusion.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_DeleteInstance_async", + "title": "DataFusion deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Date Fusion instance.", + "canonical": true, + "file": "data_fusion.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_UpdateInstance_async", + "title": "DataFusion updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": ".google.cloud.datafusion.v1.Instance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1_generated_DataFusion_RestartInstance_async", + "title": "DataFusion restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", + "canonical": true, + "file": "data_fusion.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } + } + ] +} diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js index a0186a964c1..424975969a0 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js index 830428d8c83..fe3055c1a16 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js index 874c55ae1b9..451ad6d4316 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js index f82845fbc3b..62907fca584 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js index c4732e5abe1..568b559047f 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js index 8983978ad9a..1c66bd8ba2d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js index 5c02845d9da..232d54c8740 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js index 0e8e7bb1212..2770b3920a8 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js index d7a5e09ba2e..c9372434a75 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js index bf1c14b9200..6306c3670cc 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js index b7c7520f043..04913aedc4d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js index 771ea845e22..06059b66453 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js index 2d7156c2ca7..5617a18c92b 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -1,16 +1,21 @@ -// Copyright 2021 Google LLC +// 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 +// 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'; diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json new file mode 100644 index 00000000000..664cf513fba --- /dev/null +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -0,0 +1,603 @@ +{ + "clientLibrary": { + "name": "nodejs-datafusion", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.datafusion.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async", + "title": "DataFusion listAvailableVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists possible versions for Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_available_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "latest_patch_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListInstances_async", + "title": "DataFusion listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", + "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.datafusion.v1beta1.ListInstancesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_GetInstance_async", + "title": "DataFusion getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.Instance", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_CreateInstance_async", + "title": "DataFusion createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Data Fusion instance in the specified project and location.", + "canonical": true, + "file": "data_fusion.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.datafusion.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_DeleteInstance_async", + "title": "DataFusion deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_UpdateInstance_async", + "title": "DataFusion updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": ".google.cloud.datafusion.v1beta1.Instance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_RestartInstance_async", + "title": "DataFusion restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", + "canonical": true, + "file": "data_fusion.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async", + "title": "DataFusion upgradeInstance Sample", + "origin": "API_DEFINITION", + "description": " Upgrade a single Data Fusion instance. At the end of an operation instance is fully upgraded.", + "canonical": true, + "file": "data_fusion.upgrade_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "UpgradeInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async", + "title": "DataFusion removeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Remove IAM policy that is currently set on the given resource.", + "canonical": true, + "file": "data_fusion.remove_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveIamPolicy", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RemoveIamPolicy", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListNamespaces_async", + "title": "DataFusion listNamespaces Sample", + "origin": "API_DEFINITION", + "description": " List namespaces in a given instance", + "canonical": true, + "file": "data_fusion.list_namespaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNamespaces", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.datafusion.v1beta1.NamespaceView" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListNamespacesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListNamespaces", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async", + "title": "DataFusion addDnsPeering Sample", + "origin": "API_DEFINITION", + "description": " Add DNS peering on the given resource.", + "canonical": true, + "file": "data_fusion.add_dns_peering.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dns_peering", + "type": ".google.cloud.datafusion.v1beta1.DnsPeering" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.AddDnsPeeringResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "AddDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async", + "title": "DataFusion removeDnsPeering Sample", + "origin": "API_DEFINITION", + "description": " Remove DNS peering on the given resource.", + "canonical": true, + "file": "data_fusion.remove_dns_peering.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RemoveDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + }, + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async", + "title": "DataFusion listDnsPeerings Sample", + "origin": "API_DEFINITION", + "description": " List DNS peering for a given resource.", + "canonical": true, + "file": "data_fusion.list_dns_peerings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDnsPeerings", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListDnsPeerings", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } + } + ] +} diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index 8a237af3c6d..5c96d9baa59 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -1637,9 +1637,8 @@ export class DataFusionClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.dataFusionStub!.then(stub => { + if (this.dataFusionStub && !this._terminated) { + return this.dataFusionStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index dd084a4e0fd..ee6ff9a78da 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -2573,9 +2573,8 @@ export class DataFusionClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.dataFusionStub!.then(stub => { + if (this.dataFusionStub && !this._terminated) { + return this.dataFusionStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index 3cd249d7542..7119879ca64 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -183,12 +183,27 @@ describe('v1.DataFusionClient', () => { assert(client.dataFusionStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new datafusionModule.v1.DataFusionClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.dataFusionStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -334,6 +349,22 @@ describe('v1.DataFusionClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('createInstance', () => { diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index af70ce784ba..5256f58a6f8 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -183,12 +183,27 @@ describe('v1beta1.DataFusionClient', () => { assert(client.dataFusionStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new datafusionModule.v1beta1.DataFusionClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.dataFusionStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -334,6 +349,22 @@ describe('v1beta1.DataFusionClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getInstance(request), expectedError); + }); }); describe('removeIamPolicy', () => { @@ -445,6 +476,22 @@ describe('v1beta1.DataFusionClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes removeIamPolicy with closed client', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() + ); + request.resource = ''; + const expectedHeaderRequestParams = 'resource='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeIamPolicy(request), expectedError); + }); }); describe('addDnsPeering', () => { @@ -556,6 +603,22 @@ describe('v1beta1.DataFusionClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes addDnsPeering with closed client', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.addDnsPeering(request), expectedError); + }); }); describe('removeDnsPeering', () => { @@ -667,6 +730,22 @@ describe('v1beta1.DataFusionClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes removeDnsPeering with closed client', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.removeDnsPeering(request), expectedError); + }); }); describe('createInstance', () => { From 2cabd17940f980da922b9dbfe71702334f39a22a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 16 Mar 2022 21:30:26 +0000 Subject: [PATCH 24/47] chore: update v2.14.2 gapic-generator-typescript (#37) - [ ] Regenerate this pull request now. Committer: @summer-ji-eng PiperOrigin-RevId: 434859890 Source-Link: https://github.com/googleapis/googleapis/commit/bc2432d50cba657e95212122e3fa112591b5bec2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/930b673103e92523f8cfed38decd7d3afae8ebe7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTMwYjY3MzEwM2U5MjUyM2Y4Y2ZlZDM4ZGVjZDdkM2FmYWU4ZWJlNyJ9 --- packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts | 1 - .../google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index 7119879ca64..dbcb4279cd1 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -360,7 +360,6 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index 5256f58a6f8..ed3786a99b2 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -360,7 +360,6 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -487,7 +486,6 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); request.resource = ''; - const expectedHeaderRequestParams = 'resource='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeIamPolicy(request), expectedError); @@ -614,7 +612,6 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addDnsPeering(request), expectedError); @@ -741,7 +738,6 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); request.parent = ''; - const expectedHeaderRequestParams = 'parent='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeDnsPeering(request), expectedError); From 4d6d0964253f4d33a1f14cbf809e9c091e5372ce Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 23 Mar 2022 13:48:16 -0700 Subject: [PATCH 25/47] feat: promote to stable (#38) Release-As: 1.0.0 --- packages/google-cloud-datafusion/.repo-metadata.json | 2 +- packages/google-cloud-datafusion/README.md | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-datafusion/.repo-metadata.json b/packages/google-cloud-datafusion/.repo-metadata.json index c580f1bfb06..19dbd4c6f5e 100644 --- a/packages/google-cloud-datafusion/.repo-metadata.json +++ b/packages/google-cloud-datafusion/.repo-metadata.json @@ -4,7 +4,7 @@ "product_documentation": "https://cloud.google.com/data-fusion/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/data-fusion/latest", "issue_tracker": "https://issuetracker.google.com/savedsearches/5552618", - "release_level": "preview", + "release_level": "stable", "language": "nodejs", "repo": "googleapis/nodejs-data-fusion", "distribution_name": "@google-cloud/data-fusion", diff --git a/packages/google-cloud-datafusion/README.md b/packages/google-cloud-datafusion/README.md index 12669085407..cd590741451 100644 --- a/packages/google-cloud-datafusion/README.md +++ b/packages/google-cloud-datafusion/README.md @@ -4,7 +4,7 @@ # [Cloud Data Fusion: Node.js Client](https://github.com/googleapis/nodejs-data-fusion) -[![release level](https://img.shields.io/badge/release%20level-preview-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/data-fusion.svg)](https://www.npmjs.org/package/@google-cloud/data-fusion) @@ -87,13 +87,14 @@ This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **stable**. The code surface will not change in backwards-incompatible ways +unless absolutely necessary (e.g. because of critical security issues) or with +an extensive deprecation period. Issues and requests against **stable** libraries +are addressed with the highest priority. -This library is considered to be in **preview**. This means it is still a -work-in-progress and under active development. Any release is subject to -backwards-incompatible changes at any time. More Information: [Google Cloud Platform Launch Stages][launch_stages] From cd0b06e39e72a2c4426af714cfb46fa01565063a Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 20:58:16 +0000 Subject: [PATCH 26/47] chore(main): release 1.0.0 (#39) :robot: I have created a release *beep* *boop* --- ## [1.0.0](https://github.com/googleapis/nodejs-data-fusion/compare/v0.2.0...v1.0.0) (2022-03-23) ### Features * promote to stable ([#38](https://github.com/googleapis/nodejs-data-fusion/issues/38)) ([e563f41](https://github.com/googleapis/nodejs-data-fusion/commit/e563f415e2ca24b8f8c524c8044bcf75f26ef176)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-datafusion/CHANGELOG.md | 7 +++++++ packages/google-cloud-datafusion/package.json | 2 +- packages/google-cloud-datafusion/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md index 6737bfafae4..b647f52c0c6 100644 --- a/packages/google-cloud-datafusion/CHANGELOG.md +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.0.0](https://github.com/googleapis/nodejs-data-fusion/compare/v0.2.0...v1.0.0) (2022-03-23) + + +### Features + +* promote to stable ([#38](https://github.com/googleapis/nodejs-data-fusion/issues/38)) ([e563f41](https://github.com/googleapis/nodejs-data-fusion/commit/e563f415e2ca24b8f8c524c8044bcf75f26ef176)) + ## 0.2.0 (2021-10-07) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index eddd1bf0448..2f08bbd604f 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "0.2.0", + "version": "1.0.0", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index 154c58920d6..c0c667ff96b 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^0.2.0" + "@google-cloud/data-fusion": "^1.0.0" }, "devDependencies": { "c8": "^7.1.0", From 31d79cca25971a9d324ae21f325dc7a04d3e152b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 19:46:14 +0000 Subject: [PATCH 27/47] build(node): update client library version in samples metadata (#1356) (#45) * build(node): add feat in node post-processor to add client library version number in snippet metadata Co-authored-by: Benjamin E. Coe Source-Link: https://github.com/googleapis/synthtool/commit/d337b88dd1494365183718a2de0b7b4056b6fdfe Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:d106724ad2a96daa1b8d88de101ba50bdb30b8df62ffa0aa2b451d93b4556641 --- ...t_metadata.google.cloud.datafusion.v1.json | 640 ++++----- ...adata.google.cloud.datafusion.v1beta1.json | 1152 ++++++++--------- 2 files changed, 896 insertions(+), 896 deletions(-) diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index b7faba8996a..51c60d38781 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -1,335 +1,335 @@ { - "clientLibrary": { - "name": "nodejs-datafusion", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.datafusion.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "datafusion_v1_generated_DataFusion_ListAvailableVersions_async", - "title": "DataFusion listAvailableVersions Sample", - "origin": "API_DEFINITION", - "description": " Lists possible versions for Data Fusion instances in the specified project and location.", - "canonical": true, - "file": "data_fusion.list_available_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAvailableVersions", - "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "latest_patch_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.datafusion.v1.ListAvailableVersionsResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" - }, - "method": { - "shortName": "ListAvailableVersions", - "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } + "clientLibrary": { + "name": "nodejs-datafusion", + "version": "1.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.datafusion.v1", + "version": "v1" + } + ] }, - { - "regionTag": "datafusion_v1_generated_DataFusion_ListInstances_async", - "title": "DataFusion listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Data Fusion instances in the specified project and location.", - "canonical": true, - "file": "data_fusion.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", - "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.datafusion.v1.ListInstancesResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_ListAvailableVersions_async", + "title": "DataFusion listAvailableVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists possible versions for Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_available_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "latest_patch_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.datafusion.v1.ListAvailableVersionsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListAvailableVersions", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1_generated_DataFusion_GetInstance_async", - "title": "DataFusion getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Data Fusion instance.", - "canonical": true, - "file": "data_fusion.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.datafusion.v1.Instance", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_ListInstances_async", + "title": "DataFusion listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", + "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.datafusion.v1.ListInstancesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1.DataFusion.ListInstances", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1_generated_DataFusion_CreateInstance_async", - "title": "DataFusion createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Data Fusion instance in the specified project and location.", - "canonical": true, - "file": "data_fusion.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.datafusion.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_GetInstance_async", + "title": "DataFusion getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1.Instance", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.GetInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1_generated_DataFusion_DeleteInstance_async", - "title": "DataFusion deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Date Fusion instance.", - "canonical": true, - "file": "data_fusion.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_CreateInstance_async", + "title": "DataFusion createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Data Fusion instance in the specified project and location.", + "canonical": true, + "file": "data_fusion.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.datafusion.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.CreateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1_generated_DataFusion_UpdateInstance_async", - "title": "DataFusion updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates a single Data Fusion instance.", - "canonical": true, - "file": "data_fusion.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "instance", - "type": ".google.cloud.datafusion.v1.Instance" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_DeleteInstance_async", + "title": "DataFusion deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Date Fusion instance.", + "canonical": true, + "file": "data_fusion.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.DeleteInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1_generated_DataFusion_RestartInstance_async", - "title": "DataFusion restartInstance Sample", - "origin": "API_DEFINITION", - "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", - "canonical": true, - "file": "data_fusion.restart_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1.DataFusionClient" + "regionTag": "datafusion_v1_generated_DataFusion_UpdateInstance_async", + "title": "DataFusion updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": ".google.cloud.datafusion.v1.Instance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.UpdateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } }, - "method": { - "shortName": "RestartInstance", - "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1.DataFusion" - } + { + "regionTag": "datafusion_v1_generated_DataFusion_RestartInstance_async", + "title": "DataFusion restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", + "canonical": true, + "file": "data_fusion.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1.DataFusionClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1.DataFusion.RestartInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1.DataFusion" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index 664cf513fba..df852904c76 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -1,603 +1,603 @@ { - "clientLibrary": { - "name": "nodejs-datafusion", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.datafusion.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async", - "title": "DataFusion listAvailableVersions Sample", - "origin": "API_DEFINITION", - "description": " Lists possible versions for Data Fusion instances in the specified project and location.", - "canonical": true, - "file": "data_fusion.list_available_versions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListAvailableVersions", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "latest_patch_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" - }, - "method": { - "shortName": "ListAvailableVersions", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } + "clientLibrary": { + "name": "nodejs-datafusion", + "version": "1.0.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.datafusion.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_ListInstances_async", - "title": "DataFusion listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists Data Fusion instances in the specified project and location.", - "canonical": true, - "file": "data_fusion.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 72, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", - "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.datafusion.v1beta1.ListInstancesResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_async", + "title": "DataFusion listAvailableVersions Sample", + "origin": "API_DEFINITION", + "description": " Lists possible versions for Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_available_versions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "latest_patch_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListAvailableVersions", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListAvailableVersions", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_GetInstance_async", - "title": "DataFusion getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single Data Fusion instance.", - "canonical": true, - "file": "data_fusion.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.Instance", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListInstances_async", + "title": "DataFusion listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists Data Fusion instances in the specified project and location.", + "canonical": true, + "file": "data_fusion.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 72, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", + "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.datafusion.v1beta1.ListInstancesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListInstances", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_CreateInstance_async", - "title": "DataFusion createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates a new Data Fusion instance in the specified project and location.", - "canonical": true, - "file": "data_fusion.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.datafusion.v1beta1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_GetInstance_async", + "title": "DataFusion getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.Instance", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.GetInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_DeleteInstance_async", - "title": "DataFusion deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single Data Fusion instance.", - "canonical": true, - "file": "data_fusion.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_CreateInstance_async", + "title": "DataFusion createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates a new Data Fusion instance in the specified project and location.", + "canonical": true, + "file": "data_fusion.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.datafusion.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.CreateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_UpdateInstance_async", - "title": "DataFusion updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates a single Data Fusion instance.", - "canonical": true, - "file": "data_fusion.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 62, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "instance", - "type": ".google.cloud.datafusion.v1beta1.Instance" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_DeleteInstance_async", + "title": "DataFusion deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.DeleteInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_RestartInstance_async", - "title": "DataFusion restartInstance Sample", - "origin": "API_DEFINITION", - "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", - "canonical": true, - "file": "data_fusion.restart_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestartInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_UpdateInstance_async", + "title": "DataFusion updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates a single Data Fusion instance.", + "canonical": true, + "file": "data_fusion.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "instance", + "type": ".google.cloud.datafusion.v1beta1.Instance" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpdateInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "RestartInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async", - "title": "DataFusion upgradeInstance Sample", - "origin": "API_DEFINITION", - "description": " Upgrade a single Data Fusion instance. At the end of an operation instance is fully upgraded.", - "canonical": true, - "file": "data_fusion.upgrade_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpgradeInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_RestartInstance_async", + "title": "DataFusion restartInstance Sample", + "origin": "API_DEFINITION", + "description": " Restart a single Data Fusion instance. At the end of an operation instance is fully restarted.", + "canonical": true, + "file": "data_fusion.restart_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RestartInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RestartInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "UpgradeInstance", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async", - "title": "DataFusion removeIamPolicy Sample", - "origin": "API_DEFINITION", - "description": " Remove IAM policy that is currently set on the given resource.", - "canonical": true, - "file": "data_fusion.remove_iam_policy.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 50, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveIamPolicy", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", - "async": true, - "parameters": [ - { - "name": "resource", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_UpgradeInstance_async", + "title": "DataFusion upgradeInstance Sample", + "origin": "API_DEFINITION", + "description": " Upgrade a single Data Fusion instance. At the end of an operation instance is fully upgraded.", + "canonical": true, + "file": "data_fusion.upgrade_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpgradeInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "UpgradeInstance", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.UpgradeInstance", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "RemoveIamPolicy", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_ListNamespaces_async", - "title": "DataFusion listNamespaces Sample", - "origin": "API_DEFINITION", - "description": " List namespaces in a given instance", - "canonical": true, - "file": "data_fusion.list_namespaces.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListNamespaces", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.datafusion.v1beta1.NamespaceView" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.ListNamespacesResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_async", + "title": "DataFusion removeIamPolicy Sample", + "origin": "API_DEFINITION", + "description": " Remove IAM policy that is currently set on the given resource.", + "canonical": true, + "file": "data_fusion.remove_iam_policy.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 50, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveIamPolicy", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", + "async": true, + "parameters": [ + { + "name": "resource", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RemoveIamPolicy", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveIamPolicy", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "ListNamespaces", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async", - "title": "DataFusion addDnsPeering Sample", - "origin": "API_DEFINITION", - "description": " Add DNS peering on the given resource.", - "canonical": true, - "file": "data_fusion.add_dns_peering.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "AddDnsPeering", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "dns_peering", - "type": ".google.cloud.datafusion.v1beta1.DnsPeering" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.AddDnsPeeringResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListNamespaces_async", + "title": "DataFusion listNamespaces Sample", + "origin": "API_DEFINITION", + "description": " List namespaces in a given instance", + "canonical": true, + "file": "data_fusion.list_namespaces.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListNamespaces", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.datafusion.v1beta1.NamespaceView" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListNamespacesResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListNamespaces", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListNamespaces", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "AddDnsPeering", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async", - "title": "DataFusion removeDnsPeering Sample", - "origin": "API_DEFINITION", - "description": " Remove DNS peering on the given resource.", - "canonical": true, - "file": "data_fusion.remove_dns_peering.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RemoveDnsPeering", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "zone", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_AddDnsPeering_async", + "title": "DataFusion addDnsPeering Sample", + "origin": "API_DEFINITION", + "description": " Add DNS peering on the given resource.", + "canonical": true, + "file": "data_fusion.add_dns_peering.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "AddDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "dns_peering", + "type": ".google.cloud.datafusion.v1beta1.DnsPeering" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.AddDnsPeeringResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "AddDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.AddDnsPeering", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "RemoveDnsPeering", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } - } - } - }, - { - "regionTag": "datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async", - "title": "DataFusion listDnsPeerings Sample", - "origin": "API_DEFINITION", - "description": " List DNS peering for a given resource.", - "canonical": true, - "file": "data_fusion.list_dns_peerings.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDnsPeerings", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse", - "client": { - "shortName": "DataFusionClient", - "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + "regionTag": "datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_async", + "title": "DataFusion removeDnsPeering Sample", + "origin": "API_DEFINITION", + "description": " Remove DNS peering on the given resource.", + "canonical": true, + "file": "data_fusion.remove_dns_peering.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RemoveDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "zone", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "RemoveDnsPeering", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.RemoveDnsPeering", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } }, - "method": { - "shortName": "ListDnsPeerings", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", - "service": { - "shortName": "DataFusion", - "fullName": "google.cloud.datafusion.v1beta1.DataFusion" - } + { + "regionTag": "datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_async", + "title": "DataFusion listDnsPeerings Sample", + "origin": "API_DEFINITION", + "description": " List DNS peering for a given resource.", + "canonical": true, + "file": "data_fusion.list_dns_peerings.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDnsPeerings", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse", + "client": { + "shortName": "DataFusionClient", + "fullName": "google.cloud.datafusion.v1beta1.DataFusionClient" + }, + "method": { + "shortName": "ListDnsPeerings", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion.ListDnsPeerings", + "service": { + "shortName": "DataFusion", + "fullName": "google.cloud.datafusion.v1beta1.DataFusion" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From 87adb4ce2e82621f72e201a9ae97ca57c37c7e0e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:36:11 +0200 Subject: [PATCH 28/47] chore(deps): update dependency sinon to v14 (#48) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [sinon](https://sinonjs.org/) ([source](https://togithub.com/sinonjs/sinon)) | [`^13.0.0` -> `^14.0.0`](https://renovatebot.com/diffs/npm/sinon/13.0.2/14.0.0) | [![age](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/compatibility-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/sinon/14.0.0/confidence-slim/13.0.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
sinonjs/sinon ### [`v14.0.0`](https://togithub.com/sinonjs/sinon/blob/HEAD/CHANGES.md#​1400) [Compare Source](https://togithub.com/sinonjs/sinon/compare/v13.0.2...v14.0.0) - [`c2bbd826`](https://togithub.com/sinonjs/sinon/commit/c2bbd82641444eb5b32822489ae40f185afbbf00) Drop node 12 (Morgan Roderick) > And embrace Node 18 > > See https://nodejs.org/en/about/releases/ *Released by Morgan Roderick on 2022-05-07.*
--- ### Configuration 📅 **Schedule**: "after 9am and before 3pm" (UTC). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 2f08bbd604f..0217aef3d91 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -54,7 +54,7 @@ "mocha": "^9.0.0", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", - "sinon": "^13.0.0", + "sinon": "^14.0.0", "ts-loader": "^9.1.2", "typescript": "^4.2.4", "webpack": "^5.36.2", From a7a149ca73e09c3611bbe67893111787707d97b7 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 18:50:36 -0700 Subject: [PATCH 29/47] build!: update library to use Node 12 (#50) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-datafusion/package.json | 8 ++++---- packages/google-cloud-datafusion/samples/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 0217aef3d91..b1ac78632db 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -39,7 +39,7 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^2.12.0" + "google-gax": "^3.0.1" }, "devDependencies": { "@types/mocha": "^9.0.0", @@ -51,16 +51,16 @@ "jsdoc-fresh": "^1.0.2", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.13.6", - "mocha": "^9.0.0", + "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", "sinon": "^14.0.0", "ts-loader": "^9.1.2", - "typescript": "^4.2.4", + "typescript": "^4.6.4", "webpack": "^5.36.2", "webpack-cli": "^4.7.0" }, "engines": { - "node": ">=v10.0.0" + "node": ">=12.0.0" } } diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index c0c667ff96b..b16942243e9 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=10" + "node": ">=12.0.0" }, "files": [ "*.js" From d52cd4c893ef15bfd810783dfaf571a2b8525de9 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 7 Jun 2022 11:26:00 -0400 Subject: [PATCH 30/47] chore(main): release 2.0.0 (#51) See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-datafusion/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-datafusion/package.json | 2 +- .../snippet_metadata.google.cloud.datafusion.v1.json | 2 +- ...ppet_metadata.google.cloud.datafusion.v1beta1.json | 2 +- packages/google-cloud-datafusion/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md index b647f52c0c6..dac5e71d8bf 100644 --- a/packages/google-cloud-datafusion/CHANGELOG.md +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-data-fusion/compare/v1.0.0...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#50) + +### Build System + +* update library to use Node 12 ([#50](https://github.com/googleapis/nodejs-data-fusion/issues/50)) ([464bde8](https://github.com/googleapis/nodejs-data-fusion/commit/464bde8f22a351f3c1812a8ccae2a322437c5c2b)) + ## [1.0.0](https://github.com/googleapis/nodejs-data-fusion/compare/v0.2.0...v1.0.0) (2022-03-23) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index b1ac78632db..d2051193a8e 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "1.0.0", + "version": "2.0.0", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index 51c60d38781..de30531092f 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "1.0.0", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index df852904c76..7faecb8354a 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "1.0.0", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index b16942243e9..d12eec64f96 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^1.0.0" + "@google-cloud/data-fusion": "^2.0.0" }, "devDependencies": { "c8": "^7.1.0", From 6d4050dfe8f1b57775682f449c3da7403c34c643 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:04:17 +0200 Subject: [PATCH 31/47] chore(deps): update dependency jsdoc-fresh to v2 (#53) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-fresh](https://togithub.com/googleapis/jsdoc-fresh) | [`^1.0.2` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-fresh/1.1.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/compatibility-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-fresh/2.0.0/confidence-slim/1.1.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-fresh ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-fresh/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-freshcomparev111v200-2022-05-18) [Compare Source](https://togithub.com/googleapis/jsdoc-fresh/compare/v1.1.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ##### Build System - update library to use Node 12 ([#​108](https://togithub.com/googleapis/jsdoc-fresh/issues/108)) ([e61c223](https://togithub.com/googleapis/jsdoc-fresh/commit/e61c2238db8900e339e5fe7fb8aea09642290182)) ##### [1.1.1](https://www.github.com/googleapis/jsdoc-fresh/compare/v1.1.0...v1.1.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​83](https://www.togithub.com/googleapis/jsdoc-fresh/issues/83)) ([9474adb](https://www.github.com/googleapis/jsdoc-fresh/commit/9474adbf0d559d319ff207397ba2be6b557999ac))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index d2051193a8e..fec0fff74f3 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -48,7 +48,7 @@ "c8": "^7.7.2", "gts": "^3.1.0", "jsdoc": "^3.6.6", - "jsdoc-fresh": "^1.0.2", + "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^1.0.6", "linkinator": "^2.13.6", "mocha": "^9.2.2", From 00487d5cbcf05249a7df8743a5d123587b461d86 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:26:18 +0200 Subject: [PATCH 32/47] chore(deps): update dependency jsdoc-region-tag to v2 (#54) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc-region-tag](https://togithub.com/googleapis/jsdoc-region-tag) | [`^1.0.6` -> `^2.0.0`](https://renovatebot.com/diffs/npm/jsdoc-region-tag/1.3.1/2.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/compatibility-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc-region-tag/2.0.0/confidence-slim/1.3.1)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
googleapis/jsdoc-region-tag ### [`v2.0.0`](https://togithub.com/googleapis/jsdoc-region-tag/blob/HEAD/CHANGELOG.md#​200-httpsgithubcomgoogleapisjsdoc-region-tagcomparev131v200-2022-05-20) [Compare Source](https://togithub.com/googleapis/jsdoc-region-tag/compare/v1.3.1...v2.0.0) ##### ⚠ BREAKING CHANGES - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ##### Build System - update library to use Node 12 ([#​107](https://togithub.com/googleapis/jsdoc-region-tag/issues/107)) ([5b51796](https://togithub.com/googleapis/jsdoc-region-tag/commit/5b51796771984cf8b978990025f14faa03c19923)) ##### [1.3.1](https://www.github.com/googleapis/jsdoc-region-tag/compare/v1.3.0...v1.3.1) (2021-08-11) ##### Bug Fixes - **build:** migrate to using main branch ([#​79](https://www.togithub.com/googleapis/jsdoc-region-tag/issues/79)) ([5050615](https://www.github.com/googleapis/jsdoc-region-tag/commit/50506150b7758592df5e389c6a5c3d82b3b20881))
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index fec0fff74f3..e89949a5d66 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -49,7 +49,7 @@ "gts": "^3.1.0", "jsdoc": "^3.6.6", "jsdoc-fresh": "^2.0.0", - "jsdoc-region-tag": "^1.0.6", + "jsdoc-region-tag": "^2.0.0", "linkinator": "^2.13.6", "mocha": "^9.2.2", "null-loader": "^4.0.1", From 6681feb30964ebf4c806dc4f11bee08ef5d3017b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 29 Jun 2022 17:25:21 -0700 Subject: [PATCH 33/47] feat: support regapic LRO (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: support regapic LRO Use gapic-generator-typescript v2.15.1. PiperOrigin-RevId: 456946341 Source-Link: https://github.com/googleapis/googleapis/commit/88fd18d9d3b872b3d06a3d9392879f50b5bf3ce5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/accfa371f667439313335c64042b063c1c53102e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWNjZmEzNzFmNjY3NDM5MzEzMzM1YzY0MDQyYjA2M2MxYzUzMTAyZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../src/v1/data_fusion_client.ts | 67 ++++++++++++--- .../src/v1beta1/data_fusion_client.ts | 84 ++++++++++++++++--- 2 files changed, 127 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index 5c96d9baa59..aff1d8325c2 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -74,7 +75,7 @@ export class DataFusionClient { * * @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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -97,11 +98,10 @@ export class DataFusionClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -196,16 +196,59 @@ export class DataFusionClient { }; 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/*/instances/*}:getIamPolicy', + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1/{resource=projects/*/locations/*/instances/*}:setIamPolicy', + body: '*', + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1/{resource=projects/*/locations/*/instances/*}:testIamPermissions', + body: '*', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createInstanceResponse = protoFilesRoot.lookup( '.google.cloud.datafusion.v1.Instance' diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index ee6ff9a78da..8490a1d22b0 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -74,7 +75,7 @@ export class DataFusionClient { * * @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/master/client-libraries.md#creating-the-client-instance). + * 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] @@ -97,11 +98,10 @@ export class DataFusionClient { * API remote host. * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. + * @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}. */ constructor(opts?: ClientOptions) { // Ensure that options include all the required fields. @@ -209,16 +209,76 @@ export class DataFusionClient { }; 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: '/v1beta1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1beta1/{name=projects/*}/locations', + }, + { + selector: 'google.iam.v1.IAMPolicy.GetIamPolicy', + get: '/v1beta1/{resource=projects/*/locations/*/instances/*}:getIamPolicy', + additional_bindings: [ + { + get: '/v1beta1/{resource=projects/*/locations/*/instances/*/namespaces/*}:getIamPolicy', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.SetIamPolicy', + post: '/v1beta1/{resource=projects/*/locations/*/instances/*}:setIamPolicy', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/instances/*/namespaces/*}:setIamPolicy', + body: '*', + }, + ], + }, + { + selector: 'google.iam.v1.IAMPolicy.TestIamPermissions', + post: '/v1beta1/{resource=projects/*/locations/*/instances/*}:testIamPermissions', + body: '*', + additional_bindings: [ + { + post: '/v1beta1/{resource=projects/*/locations/*/instances/*/namespaces/*}:testIamPermissions', + body: '*', + }, + ], + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1beta1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1beta1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1beta1/{name=projects/*/locations/*}/operations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createInstanceResponse = protoFilesRoot.lookup( '.google.cloud.datafusion.v1beta1.Instance' From 2c6418c4ac7d43ab63be7a4d73019509e2ab6374 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 30 Jun 2022 19:50:21 +0000 Subject: [PATCH 34/47] chore(main): release 2.1.0 (#56) :robot: I have created a release *beep* *boop* --- ## [2.1.0](https://github.com/googleapis/nodejs-data-fusion/compare/v2.0.0...v2.1.0) (2022-06-30) ### Features * support regapic LRO ([#55](https://github.com/googleapis/nodejs-data-fusion/issues/55)) ([4b66ef0](https://github.com/googleapis/nodejs-data-fusion/commit/4b66ef068c5d82e150b4bf6f2943d1708d5b0194)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --- packages/google-cloud-datafusion/CHANGELOG.md | 7 +++++++ packages/google-cloud-datafusion/package.json | 2 +- .../v1/snippet_metadata.google.cloud.datafusion.v1.json | 2 +- .../snippet_metadata.google.cloud.datafusion.v1beta1.json | 2 +- packages/google-cloud-datafusion/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md index dac5e71d8bf..c187730ab55 100644 --- a/packages/google-cloud-datafusion/CHANGELOG.md +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.0](https://github.com/googleapis/nodejs-data-fusion/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#55](https://github.com/googleapis/nodejs-data-fusion/issues/55)) ([4b66ef0](https://github.com/googleapis/nodejs-data-fusion/commit/4b66ef068c5d82e150b4bf6f2943d1708d5b0194)) + ## [2.0.0](https://github.com/googleapis/nodejs-data-fusion/compare/v1.0.0...v2.0.0) (2022-05-19) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index e89949a5d66..cd4196ac406 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "2.0.0", + "version": "2.1.0", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index de30531092f..a2e2a2d019d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index 7faecb8354a..944d65f1c24 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index d12eec64f96..bed42769ea5 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^2.0.0" + "@google-cloud/data-fusion": "^2.1.0" }, "devDependencies": { "c8": "^7.1.0", From 370b13afcc1e83e58c11e42f9fe1b3aed74611c0 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 02:02:26 +0200 Subject: [PATCH 35/47] chore(deps): update dependency linkinator to v4 (#60) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [linkinator](https://togithub.com/JustinBeckwith/linkinator) | [`^2.13.6` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.2) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.2/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
JustinBeckwith/linkinator ### [`v4.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.1...v4.0.2) ##### Bug Fixes - address srcset parsing with multiple spaces ([#​512](https://togithub.com/JustinBeckwith/linkinator/issues/512)) ([fefb5b6](https://togithub.com/JustinBeckwith/linkinator/commit/fefb5b6734fc4ab335793358c5f491338ecbeb90)) ### [`v4.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v4.0.0...v4.0.1) ##### Bug Fixes - properly parse srcset attribute ([#​510](https://togithub.com/JustinBeckwith/linkinator/issues/510)) ([9a8a83c](https://togithub.com/JustinBeckwith/linkinator/commit/9a8a83c35182b3cd4daee62a00f156767fe5c6a7)) ### [`v4.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v4.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0) ##### Features - create new release with notes ([#​508](https://togithub.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://togithub.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c)) ##### BREAKING CHANGES - The commits in [#​507](https://togithub.com/JustinBeckwith/linkinator/issues/507) and [#​506](https://togithub.com/JustinBeckwith/linkinator/issues/506) both had breaking changes. They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file. This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered. ### [`v3.1.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.1.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0) ##### Features - allow --skip to be defined multiple times ([#​399](https://togithub.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://togithub.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf)) ### [`v3.0.6`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.6) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6) ##### Bug Fixes - **deps:** upgrade node-glob to v8 ([#​397](https://togithub.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://togithub.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5)) ### [`v3.0.5`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.5) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5) ##### Bug Fixes - **deps:** upgrade to htmlparser2 v8.0.1 ([#​396](https://togithub.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://togithub.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6)) ### [`v3.0.4`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.4) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4) ##### Bug Fixes - **deps:** update dependency gaxios to v5 ([#​391](https://togithub.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://togithub.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45)) ### [`v3.0.3`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.3) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3) ##### Bug Fixes - export getConfig from index ([#​371](https://togithub.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://togithub.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1)) ### [`v3.0.2`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.2) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2) ##### Bug Fixes - allow server root with trailing slash ([#​370](https://togithub.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://togithub.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c)) ### [`v3.0.1`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.1) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1) ##### Bug Fixes - decode path parts in local web server ([#​369](https://togithub.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://togithub.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb)) ### [`v3.0.0`](https://togithub.com/JustinBeckwith/linkinator/releases/tag/v3.0.0) [Compare Source](https://togithub.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0) ##### Bug Fixes - **deps:** update dependency chalk to v5 ([#​362](https://togithub.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://togithub.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f)) - feat!: convert to es modules, drop node 10 ([#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://togithub.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#​359](https://togithub.com/JustinBeckwith/linkinator/issues/359) ##### BREAKING CHANGES - this module now requires node.js 12 and above, and has moved to es modules by default.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index cd4196ac406..c85aa5b1918 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -50,7 +50,7 @@ "jsdoc": "^3.6.6", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", - "linkinator": "^2.13.6", + "linkinator": "^4.0.0", "mocha": "^9.2.2", "null-loader": "^4.0.1", "pack-n-play": "^1.0.0-2", From c227f6e6080f8947df9999b05fc2c5a1a388533c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 00:06:31 +0000 Subject: [PATCH 36/47] fix: better support for fallback mode (#61) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 468790263 Source-Link: https://github.com/googleapis/googleapis/commit/873ab456273d105245df0fb82a6c17a814553b80 Source-Link: https://github.com/googleapis/googleapis-gen/commit/cb6f37aeff2a3472e40a7bbace8c67d75e24bee5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2I2ZjM3YWVmZjJhMzQ3MmU0MGE3YmJhY2U4YzY3ZDc1ZTI0YmVlNSJ9 --- .../v1/data_fusion.create_instance.js | 3 + .../v1/data_fusion.delete_instance.js | 3 + .../generated/v1/data_fusion.get_instance.js | 3 + .../v1/data_fusion.list_available_versions.js | 3 + .../v1/data_fusion.list_instances.js | 3 + .../v1/data_fusion.restart_instance.js | 3 + .../v1/data_fusion.update_instance.js | 3 + ...t_metadata.google.cloud.datafusion.v1.json | 14 +- .../v1beta1/data_fusion.add_dns_peering.js | 3 + .../v1beta1/data_fusion.create_instance.js | 3 + .../v1beta1/data_fusion.delete_instance.js | 3 + .../v1beta1/data_fusion.get_instance.js | 3 + .../data_fusion.list_available_versions.js | 3 + .../v1beta1/data_fusion.list_dns_peerings.js | 3 + .../v1beta1/data_fusion.list_instances.js | 3 + .../v1beta1/data_fusion.list_namespaces.js | 3 + .../v1beta1/data_fusion.remove_dns_peering.js | 3 + .../v1beta1/data_fusion.remove_iam_policy.js | 3 + .../v1beta1/data_fusion.restart_instance.js | 3 + .../v1beta1/data_fusion.update_instance.js | 3 + .../v1beta1/data_fusion.upgrade_instance.js | 3 + ...adata.google.cloud.datafusion.v1beta1.json | 26 +-- .../src/v1/data_fusion_client.ts | 20 +-- .../src/v1beta1/data_fusion_client.ts | 30 ++-- .../test/gapic_data_fusion_v1.ts | 156 +++++++++--------- .../test/gapic_data_fusion_v1beta1.ts | 156 +++++++++--------- 26 files changed, 263 insertions(+), 199 deletions(-) diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js index 350d73e4deb..ec72decc6f4 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId) { // [START datafusion_v1_generated_DataFusion_CreateInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js index 54b492907c8..751c63de054 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1_generated_DataFusion_DeleteInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js index 69aab354dab..78ca2765b7c 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1_generated_DataFusion_GetInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js index 79f75c58502..8a3c9f4b88f 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_available_versions.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1_generated_DataFusion_ListAvailableVersions_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js index 1647a8df78e..05059dbd317 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1_generated_DataFusion_ListInstances_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js index 30a39b15f30..cd5fe12367b 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.restart_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1_generated_DataFusion_RestartInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js index ffe8de3c0c2..571abda2c3d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1/data_fusion.update_instance.js @@ -23,6 +23,9 @@ function main(instance) { // [START datafusion_v1_generated_DataFusion_UpdateInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index a2e2a2d019d..fb26208fbbf 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -130,7 +130,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -170,7 +170,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -218,7 +218,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -302,7 +302,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js index 424975969a0..c8a46002cc9 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.add_dns_peering.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_AddDnsPeering_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js index fe3055c1a16..958a0666268 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId) { // [START datafusion_v1beta1_generated_DataFusion_CreateInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js index 451ad6d4316..fcdd0c0405e 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1beta1_generated_DataFusion_DeleteInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js index 62907fca584..2ea0adbd6e3 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1beta1_generated_DataFusion_GetInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js index 568b559047f..2de498c6319 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_available_versions.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_ListAvailableVersions_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js index 1c66bd8ba2d..f7534b34972 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_dns_peerings.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_ListDnsPeerings_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js index 232d54c8740..2382e1a27ff 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_ListInstances_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js index 2770b3920a8..b8cc1a2ec29 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.list_namespaces.js @@ -23,6 +23,9 @@ function main(parent) { // [START datafusion_v1beta1_generated_DataFusion_ListNamespaces_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js index c9372434a75..fcbfa78bf3c 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_dns_peering.js @@ -23,6 +23,9 @@ function main(parent, zone) { // [START datafusion_v1beta1_generated_DataFusion_RemoveDnsPeering_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js index 6306c3670cc..1623ef791b8 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.remove_iam_policy.js @@ -23,6 +23,9 @@ function main(resource) { // [START datafusion_v1beta1_generated_DataFusion_RemoveIamPolicy_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js index 04913aedc4d..e19075b7933 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.restart_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1beta1_generated_DataFusion_RestartInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js index 06059b66453..5d6bd24cc1c 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.update_instance.js @@ -23,6 +23,9 @@ function main(instance) { // [START datafusion_v1beta1_generated_DataFusion_UpdateInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js index 5617a18c92b..1a0062b7335 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/data_fusion.upgrade_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START datafusion_v1beta1_generated_DataFusion_UpgradeInstance_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. */ /** diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index 944d65f1c24..4bf253ad326 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -74,7 +74,7 @@ "segments": [ { "start": 25, - "end": 72, + "end": 75, "type": "FULL" } ], @@ -130,7 +130,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -170,7 +170,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -218,7 +218,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 62, + "end": 65, "type": "FULL" } ], @@ -302,7 +302,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -342,7 +342,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -382,7 +382,7 @@ "segments": [ { "start": 25, - "end": 50, + "end": 53, "type": "FULL" } ], @@ -422,7 +422,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -474,7 +474,7 @@ "segments": [ { "start": 25, - "end": 54, + "end": 57, "type": "FULL" } ], @@ -518,7 +518,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 58, "type": "FULL" } ], @@ -562,7 +562,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index aff1d8325c2..bcd50348599 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -378,7 +377,8 @@ export class DataFusionClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -662,7 +662,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1.Instance, @@ -800,7 +800,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -946,7 +946,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1.Instance, @@ -1085,7 +1085,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.restartInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1.Instance, @@ -1242,7 +1242,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAvailableVersions.createStream( - this.innerApiCalls.listAvailableVersions as gax.GaxCall, + this.innerApiCalls.listAvailableVersions as GaxCall, request, callSettings ); @@ -1296,7 +1296,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listAvailableVersions.asyncIterate( this.innerApiCalls['listAvailableVersions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1453,7 +1453,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as gax.GaxCall, + this.innerApiCalls.listInstances as GaxCall, request, callSettings ); @@ -1509,7 +1509,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index 8490a1d22b0..47ae1a252ae 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -30,7 +30,6 @@ import { } from 'google-gax'; import {Transform} from 'stream'; -import {RequestType} from 'google-gax/build/src/apitypes'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); /** @@ -425,7 +424,8 @@ export class DataFusionClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -1004,7 +1004,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1beta1.Instance, @@ -1142,7 +1142,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1288,7 +1288,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1beta1.Instance, @@ -1427,7 +1427,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.restartInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1beta1.Instance, @@ -1568,7 +1568,7 @@ export class DataFusionClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.upgradeInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.datafusion.v1beta1.Instance, @@ -1725,7 +1725,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listAvailableVersions.createStream( - this.innerApiCalls.listAvailableVersions as gax.GaxCall, + this.innerApiCalls.listAvailableVersions as GaxCall, request, callSettings ); @@ -1779,7 +1779,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listAvailableVersions.asyncIterate( this.innerApiCalls['listAvailableVersions'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -1936,7 +1936,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as gax.GaxCall, + this.innerApiCalls.listInstances as GaxCall, request, callSettings ); @@ -1992,7 +1992,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2145,7 +2145,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listNamespaces.createStream( - this.innerApiCalls.listNamespaces as gax.GaxCall, + this.innerApiCalls.listNamespaces as GaxCall, request, callSettings ); @@ -2199,7 +2199,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listNamespaces.asyncIterate( this.innerApiCalls['listNamespaces'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2342,7 +2342,7 @@ export class DataFusionClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listDnsPeerings.createStream( - this.innerApiCalls.listDnsPeerings as gax.GaxCall, + this.innerApiCalls.listDnsPeerings as GaxCall, request, callSettings ); @@ -2391,7 +2391,7 @@ export class DataFusionClient { this.initialize(); return this.descriptors.page.listDnsPeerings.asyncIterate( this.innerApiCalls['listDnsPeerings'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index dbcb4279cd1..b4c6ba64fab 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -145,99 +145,101 @@ function stubAsyncIterationCall( } describe('v1.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1.DataFusionClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datafusionModule.v1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new datafusionModule.v1.DataFusionClient(); - assert(client); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1.DataFusionClient.servicePath; + assert(servicePath); + }); - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1.DataFusionClient({ - fallback: true, + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has port', () => { + const port = datafusionModule.v1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); - }); - it('has close method for the initialized client', done => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new datafusionModule.v1.DataFusionClient(); + assert(client); }); - client.initialize(); - assert(client.dataFusionStub); - client.close().then(() => { - done(); + + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1.DataFusionClient({ + fallback: true, + }); + assert(client); }); - }); - it('has close method for the non-initialized client', done => { - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); }); - assert.strictEqual(client.dataFusionStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the initialized client', done => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataFusionStub); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = new datafusionModule.v1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + client.close().then(() => { + done(); + }); }); - 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 datafusionModule.v1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1.DataFusionClient({ + 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()); }); - 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); - } + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1.DataFusionClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getInstance', () => { diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index ed3786a99b2..594515b3ba5 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -145,99 +145,101 @@ function stubAsyncIterationCall( } describe('v1beta1.DataFusionClient', () => { - it('has servicePath', () => { - const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = datafusionModule.v1beta1.DataFusionClient.port; - assert(port); - assert(typeof port === 'number'); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = datafusionModule.v1beta1.DataFusionClient.servicePath; + assert(servicePath); + }); - it('should create a client with no option', () => { - const client = new datafusionModule.v1beta1.DataFusionClient(); - assert(client); - }); + it('has apiEndpoint', () => { + const apiEndpoint = datafusionModule.v1beta1.DataFusionClient.apiEndpoint; + assert(apiEndpoint); + }); - it('should create a client with gRPC fallback', () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - fallback: true, + it('has port', () => { + const port = datafusionModule.v1beta1.DataFusionClient.port; + assert(port); + assert(typeof port === 'number'); }); - assert(client); - }); - it('has initialize method and supports deferred initialization', async () => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with no option', () => { + const client = new datafusionModule.v1beta1.DataFusionClient(); + assert(client); }); - assert.strictEqual(client.dataFusionStub, undefined); - await client.initialize(); - assert(client.dataFusionStub); - }); - it('has close method for the initialized client', done => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('should create a client with gRPC fallback', () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + fallback: true, + }); + assert(client); }); - client.initialize(); - assert(client.dataFusionStub); - client.close().then(() => { - done(); + + it('has initialize method and supports deferred initialization', async () => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + await client.initialize(); + assert(client.dataFusionStub); }); - }); - it('has close method for the non-initialized client', done => { - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.dataFusionStub); + client.close().then(() => { + done(); + }); }); - assert.strictEqual(client.dataFusionStub, undefined); - client.close().then(() => { - done(); + + it('has close method for the non-initialized client', done => { + const client = new datafusionModule.v1beta1.DataFusionClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.dataFusionStub, undefined); + client.close().then(() => { + done(); + }); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new datafusionModule.v1beta1.DataFusionClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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()); }); - 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 datafusionModule.v1beta1.DataFusionClient({ - 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); - } + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new datafusionModule.v1beta1.DataFusionClient({ + 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); }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); }); describe('getInstance', () => { From 2ac94f4dee83d6ffb8f336eab5e5a725cdecfa9a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 07:34:24 +0000 Subject: [PATCH 37/47] fix: change import long to require (#62) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../protos/protos.d.ts | 975 ++- .../google-cloud-datafusion/protos/protos.js | 5259 ++++++++++++----- .../protos/protos.json | 65 + 3 files changed, 4885 insertions(+), 1414 deletions(-) diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index ae3b110c741..72bd8baf8e6 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import * as Long from "long"; +import Long = require("long"); import {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { @@ -148,49 +148,49 @@ export namespace google { namespace DataFusion { /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listAvailableVersions}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|listAvailableVersions}. * @param error Error, if any * @param [response] ListAvailableVersionsResponse */ type ListAvailableVersionsCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.ListAvailableVersionsResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listInstances}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#getInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.datafusion.v1.Instance) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#createInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|createInstance}. * @param error Error, if any * @param [response] Operation */ type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#deleteInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|deleteInstance}. * @param error Error, if any * @param [response] Operation */ type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#updateInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|updateInstance}. * @param error Error, if any * @param [response] Operation */ type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#restartInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|restartInstance}. * @param error Error, if any * @param [response] Operation */ @@ -291,6 +291,13 @@ export namespace google { * @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 Version. */ @@ -399,6 +406,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Version { @@ -505,6 +519,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Accelerator { @@ -614,6 +635,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CryptoKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Instance. */ @@ -866,6 +894,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Instance { @@ -1012,6 +1047,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListInstancesResponse. */ @@ -1114,6 +1156,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAvailableVersionsRequest. */ @@ -1222,6 +1271,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAvailableVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAvailableVersionsResponse. */ @@ -1318,6 +1374,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAvailableVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetInstanceRequest. */ @@ -1408,6 +1471,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateInstanceRequest. */ @@ -1510,6 +1580,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteInstanceRequest. */ @@ -1600,6 +1677,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateInstanceRequest. */ @@ -1696,6 +1780,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RestartInstanceRequest. */ @@ -1786,6 +1877,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationMetadata. */ @@ -1918,6 +2016,13 @@ export namespace google { * @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; } } @@ -2130,91 +2235,91 @@ export namespace google { namespace DataFusion { /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listAvailableVersions}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listAvailableVersions}. * @param error Error, if any * @param [response] ListAvailableVersionsResponse */ type ListAvailableVersionsCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listInstances}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#getInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.Instance) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#createInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|createInstance}. * @param error Error, if any * @param [response] Operation */ type CreateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#deleteInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|deleteInstance}. * @param error Error, if any * @param [response] Operation */ type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#updateInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|updateInstance}. * @param error Error, if any * @param [response] Operation */ type UpdateInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#restartInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|restartInstance}. * @param error Error, if any * @param [response] Operation */ type RestartInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#upgradeInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|upgradeInstance}. * @param error Error, if any * @param [response] Operation */ type UpgradeInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeIamPolicy}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|removeIamPolicy}. * @param error Error, if any * @param [response] RemoveIamPolicyResponse */ type RemoveIamPolicyCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listNamespaces}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listNamespaces}. * @param error Error, if any * @param [response] ListNamespacesResponse */ type ListNamespacesCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.ListNamespacesResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#addDnsPeering}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|addDnsPeering}. * @param error Error, if any * @param [response] AddDnsPeeringResponse */ type AddDnsPeeringCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.AddDnsPeeringResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeDnsPeering}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|removeDnsPeering}. * @param error Error, if any * @param [response] RemoveDnsPeeringResponse */ type RemoveDnsPeeringCallback = (error: (Error|null), response?: google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse) => void; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listDnsPeerings}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listDnsPeerings}. * @param error Error, if any * @param [response] ListDnsPeeringsResponse */ @@ -2315,6 +2420,13 @@ export namespace google { * @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 Version. */ @@ -2423,6 +2535,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Version + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Version { @@ -2523,6 +2642,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Accelerator + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Accelerator { @@ -2623,6 +2749,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CryptoKeyConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Instance. */ @@ -2875,6 +3008,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Instance + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Instance { @@ -3021,6 +3161,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListInstancesResponse. */ @@ -3123,6 +3270,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListInstancesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAvailableVersionsRequest. */ @@ -3231,6 +3385,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAvailableVersionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListAvailableVersionsResponse. */ @@ -3327,6 +3488,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListAvailableVersionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetInstanceRequest. */ @@ -3417,6 +3585,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a CreateInstanceRequest. */ @@ -3519,6 +3694,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteInstanceRequest. */ @@ -3609,6 +3791,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateInstanceRequest. */ @@ -3705,6 +3894,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RestartInstanceRequest. */ @@ -3795,6 +3991,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestartInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpgradeInstanceRequest. */ @@ -3885,6 +4088,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpgradeInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an OperationMetadata. */ @@ -4011,6 +4221,13 @@ export namespace google { * @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 RemoveIamPolicyRequest. */ @@ -4101,6 +4318,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveIamPolicyRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RemoveIamPolicyResponse. */ @@ -4185,6 +4409,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveIamPolicyResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNamespacesRequest. */ @@ -4293,6 +4524,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNamespacesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a IAMPolicy. */ @@ -4389,6 +4627,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for IAMPolicy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Namespace. */ @@ -4485,6 +4730,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Namespace + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListNamespacesResponse. */ @@ -4581,6 +4833,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListNamespacesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DnsPeering. */ @@ -4695,6 +4954,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DnsPeering + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AddDnsPeeringRequest. */ @@ -4791,6 +5057,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddDnsPeeringRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an AddDnsPeeringResponse. */ @@ -4875,6 +5148,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AddDnsPeeringResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** NamespaceView enum. */ @@ -4978,6 +5258,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveDnsPeeringRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a RemoveDnsPeeringResponse. */ @@ -5062,6 +5349,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RemoveDnsPeeringResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListDnsPeeringsRequest. */ @@ -5164,6 +5458,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsPeeringsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListDnsPeeringsResponse. */ @@ -5260,6 +5561,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDnsPeeringsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -5362,6 +5670,13 @@ export namespace google { * @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. */ @@ -5509,6 +5824,13 @@ export namespace google { * @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. */ @@ -5605,6 +5927,13 @@ export namespace google { * @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. */ @@ -5743,6 +6072,13 @@ export namespace google { * @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 { @@ -5855,6 +6191,13 @@ export namespace google { * @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; } } @@ -5949,6 +6292,13 @@ export namespace google { * @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. */ @@ -5989,6 +6339,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -6036,6 +6389,9 @@ export namespace google { /** FileDescriptorProto syntax. */ public syntax: string; + /** FileDescriptorProto edition. */ + public edition: string; + /** * Creates a new FileDescriptorProto instance using the specified properties. * @param [properties] Properties to set @@ -6105,6 +6461,13 @@ export namespace google { * @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. */ @@ -6249,6 +6612,13 @@ export namespace google { * @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 { @@ -6353,6 +6723,13 @@ export namespace google { * @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. */ @@ -6449,6 +6826,13 @@ export namespace google { * @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; } } @@ -6540,6 +6924,13 @@ export namespace google { * @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. */ @@ -6690,6 +7081,13 @@ export namespace google { * @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 { @@ -6818,6 +7216,13 @@ export namespace google { * @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. */ @@ -6932,6 +7337,13 @@ export namespace google { * @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 { @@ -7030,6 +7442,13 @@ export namespace google { * @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; } } @@ -7133,6 +7552,13 @@ export namespace google { * @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. */ @@ -7235,6 +7661,13 @@ export namespace google { * @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. */ @@ -7355,6 +7788,13 @@ export namespace google { * @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. */ @@ -7568,6 +8008,13 @@ export namespace google { * @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 { @@ -7695,6 +8142,13 @@ export namespace google { * @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. */ @@ -7712,6 +8166,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -7749,6 +8206,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -7827,6 +8287,13 @@ export namespace google { * @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 { @@ -7934,6 +8401,13 @@ export namespace google { * @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. */ @@ -8036,6 +8510,13 @@ export namespace google { * @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. */ @@ -8132,6 +8613,13 @@ export namespace google { * @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. */ @@ -8234,6 +8722,13 @@ export namespace google { * @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. */ @@ -8345,6 +8840,13 @@ export namespace google { * @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 { @@ -8481,6 +8983,13 @@ export namespace google { * @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 { @@ -8579,6 +9088,13 @@ export namespace google { * @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; } } @@ -8670,6 +9186,13 @@ export namespace google { * @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 { @@ -8786,6 +9309,13 @@ export namespace google { * @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; } } @@ -8877,6 +9407,13 @@ export namespace google { * @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 { @@ -8895,6 +9432,9 @@ export namespace google { /** Annotation end */ end?: (number|null); + + /** Annotation semantic */ + semantic?: (google.protobuf.GeneratedCodeInfo.Annotation.Semantic|keyof typeof google.protobuf.GeneratedCodeInfo.Annotation.Semantic|null); } /** Represents an Annotation. */ @@ -8918,6 +9458,9 @@ export namespace google { /** 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 @@ -8987,6 +9530,23 @@ export namespace google { * @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 + } } } @@ -9084,6 +9644,13 @@ export namespace google { * @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. */ @@ -9180,6 +9747,13 @@ export namespace google { * @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. */ @@ -9264,6 +9838,13 @@ export namespace google { * @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. */ @@ -9354,6 +9935,13 @@ export namespace google { * @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. */ @@ -9450,6 +10038,13 @@ export namespace google { * @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; } } @@ -9550,35 +10145,35 @@ export namespace google { namespace Operations { /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * 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}. + * 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}. + * 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}. + * 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}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @param error Error, if any * @param [response] Operation */ @@ -9700,6 +10295,13 @@ export namespace google { * @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. */ @@ -9790,6 +10392,13 @@ export namespace google { * @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. */ @@ -9898,6 +10507,13 @@ export namespace google { * @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. */ @@ -9994,6 +10610,13 @@ export namespace google { * @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. */ @@ -10084,6 +10707,13 @@ export namespace google { * @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. */ @@ -10174,6 +10804,13 @@ export namespace google { * @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. */ @@ -10270,6 +10907,13 @@ export namespace google { * @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. */ @@ -10366,6 +11010,13 @@ export namespace google { * @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; } } @@ -10472,6 +11123,13 @@ export namespace google { * @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; } } @@ -10490,6 +11148,9 @@ export namespace google { /** Policy bindings */ bindings?: (google.iam.v1.IBinding[]|null); + /** Policy auditConfigs */ + auditConfigs?: (google.iam.v1.IAuditConfig[]|null); + /** Policy etag */ etag?: (Uint8Array|string|null); } @@ -10509,6 +11170,9 @@ export namespace google { /** Policy bindings. */ public bindings: google.iam.v1.IBinding[]; + /** Policy auditConfigs. */ + public auditConfigs: google.iam.v1.IAuditConfig[]; + /** Policy etag. */ public etag: (Uint8Array|string); @@ -10581,6 +11245,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Policy + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a Binding. */ @@ -10683,6 +11354,230 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Binding + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditConfig. */ + interface IAuditConfig { + + /** AuditConfig service */ + service?: (string|null); + + /** AuditConfig auditLogConfigs */ + auditLogConfigs?: (google.iam.v1.IAuditLogConfig[]|null); + } + + /** Represents an AuditConfig. */ + class AuditConfig implements IAuditConfig { + + /** + * Constructs a new AuditConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditConfig); + + /** AuditConfig service. */ + public service: string; + + /** AuditConfig auditLogConfigs. */ + public auditLogConfigs: google.iam.v1.IAuditLogConfig[]; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditConfig instance + */ + public static create(properties?: google.iam.v1.IAuditConfig): google.iam.v1.AuditConfig; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @param message AuditConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditConfig; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditConfig; + + /** + * Verifies an AuditConfig message. + * @param message Plain 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 AuditConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditConfig; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @param message AuditConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AuditLogConfig. */ + interface IAuditLogConfig { + + /** AuditLogConfig logType */ + logType?: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType|null); + + /** AuditLogConfig exemptedMembers */ + exemptedMembers?: (string[]|null); + } + + /** Represents an AuditLogConfig. */ + class AuditLogConfig implements IAuditLogConfig { + + /** + * Constructs a new AuditLogConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.iam.v1.IAuditLogConfig); + + /** AuditLogConfig logType. */ + public logType: (google.iam.v1.AuditLogConfig.LogType|keyof typeof google.iam.v1.AuditLogConfig.LogType); + + /** AuditLogConfig exemptedMembers. */ + public exemptedMembers: string[]; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AuditLogConfig instance + */ + public static create(properties?: google.iam.v1.IAuditLogConfig): google.iam.v1.AuditLogConfig; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @param message AuditLogConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.iam.v1.IAuditLogConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.iam.v1.AuditLogConfig; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.iam.v1.AuditLogConfig; + + /** + * Verifies an AuditLogConfig message. + * @param message Plain 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 AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AuditLogConfig + */ + public static fromObject(object: { [k: string]: any }): google.iam.v1.AuditLogConfig; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @param message AuditLogConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.iam.v1.AuditLogConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AuditLogConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditLogConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AuditLogConfig { + + /** LogType enum. */ + enum LogType { + LOG_TYPE_UNSPECIFIED = 0, + ADMIN_READ = 1, + DATA_WRITE = 2, + DATA_READ = 3 + } } /** Properties of a PolicyDelta. */ @@ -10779,6 +11674,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PolicyDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BindingDelta. */ @@ -10887,6 +11789,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BindingDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace BindingDelta { @@ -11005,6 +11914,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AuditConfigDelta + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace AuditConfigDelta { @@ -11128,6 +12044,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Expr + * @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-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index a83d3f6da30..70e18ef16b8 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -99,7 +99,7 @@ }; /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listAvailableVersions}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|listAvailableVersions}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef ListAvailableVersionsCallback * @type {function} @@ -132,7 +132,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#listInstances}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|listInstances}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef ListInstancesCallback * @type {function} @@ -165,7 +165,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#getInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|getInstance}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef GetInstanceCallback * @type {function} @@ -198,7 +198,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#createInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|createInstance}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef CreateInstanceCallback * @type {function} @@ -231,7 +231,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#deleteInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|deleteInstance}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef DeleteInstanceCallback * @type {function} @@ -264,7 +264,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#updateInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|updateInstance}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef UpdateInstanceCallback * @type {function} @@ -297,7 +297,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1.DataFusion#restartInstance}. + * Callback as used by {@link google.cloud.datafusion.v1.DataFusion|restartInstance}. * @memberof google.cloud.datafusion.v1.DataFusion * @typedef RestartInstanceCallback * @type {function} @@ -435,12 +435,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.network = reader.string(); - break; - case 2: - message.ipAllocation = reader.string(); - break; + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.ipAllocation = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -539,6 +541,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.datafusion.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.datafusion.v1.NetworkConfig"; + }; + return NetworkConfig; })(); @@ -669,20 +686,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.versionNumber = reader.string(); - break; - case 2: - message.defaultVersion = reader.bool(); - break; - case 3: - if (!(message.availableFeatures && message.availableFeatures.length)) - message.availableFeatures = []; - message.availableFeatures.push(reader.string()); - break; - case 4: - message.type = reader.int32(); - break; + case 1: { + message.versionNumber = reader.string(); + break; + } + case 2: { + message.defaultVersion = reader.bool(); + break; + } + case 3: { + if (!(message.availableFeatures && message.availableFeatures.length)) + message.availableFeatures = []; + message.availableFeatures.push(reader.string()); + break; + } + case 4: { + message.type = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -828,6 +849,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.Version"; + }; + /** * Type enum. * @name google.cloud.datafusion.v1.Version.Type @@ -950,12 +986,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.acceleratorType = reader.int32(); - break; - case 2: - message.state = reader.int32(); - break; + case 1: { + message.acceleratorType = reader.int32(); + break; + } + case 2: { + message.state = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -1100,6 +1138,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.Accelerator"; + }; + /** * AcceleratorType enum. * @name google.cloud.datafusion.v1.Accelerator.AcceleratorType @@ -1231,9 +1284,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.keyReference = reader.string(); - break; + case 1: { + message.keyReference = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -1323,6 +1377,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CryptoKeyConfig + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.CryptoKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.CryptoKeyConfig"; + }; + return CryptoKeyConfig; })(); @@ -1728,139 +1797,167 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.type = reader.int32(); - break; - case 4: - message.enableStackdriverLogging = reader.bool(); - break; - case 5: - message.enableStackdriverMonitoring = reader.bool(); - break; - case 6: - message.privateInstance = reader.bool(); - break; - case 7: - message.networkConfig = $root.google.cloud.datafusion.v1.NetworkConfig.decode(reader, reader.uint32()); - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } + case 1: { + message.name = reader.string(); + break; } - message.labels[key] = value; - break; - case 9: - if (message.options === $util.emptyObject) - message.options = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 5: { + message.enableStackdriverMonitoring = reader.bool(); + break; + } + case 6: { + message.privateInstance = reader.bool(); + break; + } + case 7: { + message.networkConfig = $root.google.cloud.datafusion.v1.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.options[key] = value; - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.state = reader.int32(); - break; - case 13: - message.stateMessage = reader.string(); - break; - case 14: - message.serviceEndpoint = reader.string(); - break; - case 15: - message.zone = reader.string(); - break; - case 16: - message.version = reader.string(); - break; - case 17: - message.serviceAccount = reader.string(); - break; - case 18: - message.displayName = reader.string(); - break; - case 19: - if (!(message.availableVersion && message.availableVersion.length)) - message.availableVersion = []; - message.availableVersion.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); - break; - case 20: - message.apiEndpoint = reader.string(); - break; - case 21: - message.gcsBucket = reader.string(); - break; - case 22: - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.datafusion.v1.Accelerator.decode(reader, reader.uint32())); - break; - case 23: - message.p4ServiceAccount = reader.string(); - break; - case 24: - message.tenantProjectId = reader.string(); - break; - case 25: - message.dataprocServiceAccount = reader.string(); - break; - case 27: - message.enableRbac = reader.bool(); - break; - case 28: - message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.decode(reader, reader.uint32()); - break; - case 29: - if (!(message.disabledReason && message.disabledReason.length)) - message.disabledReason = []; - if ((tag & 7) === 2) { + case 9: { + if (message.options === $util.emptyObject) + message.options = {}; var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.options[key] = value; + break; + } + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 13: { + message.stateMessage = reader.string(); + break; + } + case 14: { + message.serviceEndpoint = reader.string(); + break; + } + case 15: { + message.zone = reader.string(); + break; + } + case 16: { + message.version = reader.string(); + break; + } + case 17: { + message.serviceAccount = reader.string(); + break; + } + case 18: { + message.displayName = reader.string(); + break; + } + case 19: { + if (!(message.availableVersion && message.availableVersion.length)) + message.availableVersion = []; + message.availableVersion.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); + break; + } + case 20: { + message.apiEndpoint = reader.string(); + break; + } + case 21: { + message.gcsBucket = reader.string(); + break; + } + case 22: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.datafusion.v1.Accelerator.decode(reader, reader.uint32())); + break; + } + case 23: { + message.p4ServiceAccount = reader.string(); + break; + } + case 24: { + message.tenantProjectId = reader.string(); + break; + } + case 25: { + message.dataprocServiceAccount = reader.string(); + break; + } + case 27: { + message.enableRbac = reader.bool(); + break; + } + case 28: { + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1.CryptoKeyConfig.decode(reader, reader.uint32()); + break; + } + case 29: { + if (!(message.disabledReason && message.disabledReason.length)) + message.disabledReason = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.disabledReason.push(reader.int32()); + } else message.disabledReason.push(reader.int32()); - } else - message.disabledReason.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -2360,6 +2457,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.Instance"; + }; + /** * Type enum. * @name google.cloud.datafusion.v1.Instance.Type @@ -2563,21 +2675,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; + case 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; @@ -2700,6 +2817,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.ListInstancesRequest"; + }; + return ListInstancesRequest; })(); @@ -2821,19 +2953,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.datafusion.v1.Instance.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; + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.datafusion.v1.Instance.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; @@ -2970,6 +3105,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -3098,18 +3248,22 @@ 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.latestPatchOnly = reader.bool(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.latestPatchOnly = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -3224,6 +3378,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAvailableVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAvailableVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.ListAvailableVersionsRequest"; + }; + return ListAvailableVersionsRequest; })(); @@ -3332,14 +3501,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.availableVersions && message.availableVersions.length)) - message.availableVersions = []; - message.availableVersions.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.availableVersions && message.availableVersions.length)) + message.availableVersions = []; + message.availableVersions.push($root.google.cloud.datafusion.v1.Version.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3455,6 +3626,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAvailableVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.ListAvailableVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAvailableVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.ListAvailableVersionsResponse"; + }; + return ListAvailableVersionsResponse; })(); @@ -3550,9 +3736,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3642,6 +3829,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.GetInstanceRequest"; + }; + return GetInstanceRequest; })(); @@ -3759,15 +3961,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.instanceId = reader.string(); - break; - case 3: - message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3879,6 +4084,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -3974,9 +4194,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4066,6 +4287,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -4172,12 +4408,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.instance = $root.google.cloud.datafusion.v1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -4286,6 +4524,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -4381,9 +4634,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4473,6 +4727,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1.RestartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1.RestartInstanceRequest"; + }; + return RestartInstanceRequest; })(); @@ -4647,49 +4916,57 @@ 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.statusDetail = reader.string(); - break; - case 6: - message.requestedCancellation = reader.bool(); - break; - case 7: - message.apiVersion = reader.string(); - break; - case 8: - if (message.additionalStatus === $util.emptyObject) - message.additionalStatus = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + 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.statusDetail = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + case 8: { + if (message.additionalStatus === $util.emptyObject) + message.additionalStatus = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.additionalStatus[key] = value; + break; } - message.additionalStatus[key] = value; - break; default: reader.skipType(tag & 7); break; @@ -4861,6 +5138,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datafusion.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.datafusion.v1.OperationMetadata"; + }; + return OperationMetadata; })(); @@ -4909,7 +5201,7 @@ }; /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listAvailableVersions}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listAvailableVersions}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef ListAvailableVersionsCallback * @type {function} @@ -4942,7 +5234,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listInstances}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listInstances}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef ListInstancesCallback * @type {function} @@ -4975,7 +5267,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#getInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|getInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef GetInstanceCallback * @type {function} @@ -5008,7 +5300,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#createInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|createInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef CreateInstanceCallback * @type {function} @@ -5041,7 +5333,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#deleteInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|deleteInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef DeleteInstanceCallback * @type {function} @@ -5074,7 +5366,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#updateInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|updateInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef UpdateInstanceCallback * @type {function} @@ -5107,7 +5399,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#restartInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|restartInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef RestartInstanceCallback * @type {function} @@ -5140,7 +5432,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#upgradeInstance}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|upgradeInstance}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef UpgradeInstanceCallback * @type {function} @@ -5173,7 +5465,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeIamPolicy}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|removeIamPolicy}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef RemoveIamPolicyCallback * @type {function} @@ -5206,7 +5498,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listNamespaces}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listNamespaces}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef ListNamespacesCallback * @type {function} @@ -5239,7 +5531,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#addDnsPeering}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|addDnsPeering}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef AddDnsPeeringCallback * @type {function} @@ -5272,7 +5564,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#removeDnsPeering}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|removeDnsPeering}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef RemoveDnsPeeringCallback * @type {function} @@ -5305,7 +5597,7 @@ */ /** - * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion#listDnsPeerings}. + * Callback as used by {@link google.cloud.datafusion.v1beta1.DataFusion|listDnsPeerings}. * @memberof google.cloud.datafusion.v1beta1.DataFusion * @typedef ListDnsPeeringsCallback * @type {function} @@ -5443,12 +5735,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.network = reader.string(); - break; - case 2: - message.ipAllocation = reader.string(); - break; + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.ipAllocation = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5547,6 +5841,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.NetworkConfig"; + }; + return NetworkConfig; })(); @@ -5677,20 +5986,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.versionNumber = reader.string(); - break; - case 2: - message.defaultVersion = reader.bool(); - break; - case 3: - if (!(message.availableFeatures && message.availableFeatures.length)) - message.availableFeatures = []; - message.availableFeatures.push(reader.string()); - break; - case 4: - message.type = reader.int32(); - break; + case 1: { + message.versionNumber = reader.string(); + break; + } + case 2: { + message.defaultVersion = reader.bool(); + break; + } + case 3: { + if (!(message.availableFeatures && message.availableFeatures.length)) + message.availableFeatures = []; + message.availableFeatures.push(reader.string()); + break; + } + case 4: { + message.type = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -5836,6 +6149,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Version + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.Version + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Version.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.Version"; + }; + /** * Type enum. * @name google.cloud.datafusion.v1beta1.Version.Type @@ -5947,9 +6275,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.acceleratorType = reader.int32(); - break; + case 1: { + message.acceleratorType = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -6057,6 +6386,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Accelerator + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.Accelerator + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Accelerator.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.Accelerator"; + }; + /** * AcceleratorType enum. * @name google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType @@ -6168,9 +6512,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.keyReference = reader.string(); - break; + case 1: { + message.keyReference = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -6260,6 +6605,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CryptoKeyConfig + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.CryptoKeyConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CryptoKeyConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.CryptoKeyConfig"; + }; + return CryptoKeyConfig; })(); @@ -6665,141 +7025,169 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.type = reader.int32(); - break; - case 4: - message.enableStackdriverLogging = reader.bool(); - break; - case 5: - message.enableStackdriverMonitoring = reader.bool(); - break; - case 6: - message.privateInstance = reader.bool(); - break; - case 7: - message.networkConfig = $root.google.cloud.datafusion.v1beta1.NetworkConfig.decode(reader, reader.uint32()); - break; - case 8: - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.enableStackdriverLogging = reader.bool(); + break; + } + case 5: { + message.enableStackdriverMonitoring = reader.bool(); + break; + } + case 6: { + message.privateInstance = reader.bool(); + break; + } + case 7: { + message.networkConfig = $root.google.cloud.datafusion.v1beta1.NetworkConfig.decode(reader, reader.uint32()); + break; + } + case 8: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; } - message.labels[key] = value; - break; - case 9: - if (message.options === $util.emptyObject) - message.options = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; + case 9: { + if (message.options === $util.emptyObject) + message.options = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.options[key] = value; + break; } - message.options[key] = value; - break; - case 10: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 11: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 12: - message.state = reader.int32(); - break; - case 13: - message.stateMessage = reader.string(); - break; - case 14: - message.serviceEndpoint = reader.string(); - break; - case 15: - message.zone = reader.string(); - break; - case 16: - message.version = reader.string(); - break; - case 17: - message.serviceAccount = reader.string(); - break; - case 18: - message.displayName = reader.string(); - break; - case 19: - if (!(message.availableVersion && message.availableVersion.length)) - message.availableVersion = []; - message.availableVersion.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); - break; - case 20: - message.apiEndpoint = reader.string(); - break; - case 21: - message.gcsBucket = reader.string(); - break; - case 22: - if (!(message.accelerators && message.accelerators.length)) - message.accelerators = []; - message.accelerators.push($root.google.cloud.datafusion.v1beta1.Accelerator.decode(reader, reader.uint32())); - break; - case 23: - message.p4ServiceAccount = reader.string(); - break; - case 24: - message.tenantProjectId = reader.string(); - break; - case 25: - message.dataprocServiceAccount = reader.string(); - break; - case 26: - message.enableRbac = reader.bool(); - break; - case 27: - message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.decode(reader, reader.uint32()); - break; - case 28: - if (!(message.disabledReason && message.disabledReason.length)) - message.disabledReason = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.disabledReason.push(reader.int32()); - } else - message.disabledReason.push(reader.int32()); - break; - default: - reader.skipType(tag & 7); + case 10: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 12: { + message.state = reader.int32(); + break; + } + case 13: { + message.stateMessage = reader.string(); + break; + } + case 14: { + message.serviceEndpoint = reader.string(); + break; + } + case 15: { + message.zone = reader.string(); + break; + } + case 16: { + message.version = reader.string(); + break; + } + case 17: { + message.serviceAccount = reader.string(); + break; + } + case 18: { + message.displayName = reader.string(); + break; + } + case 19: { + if (!(message.availableVersion && message.availableVersion.length)) + message.availableVersion = []; + message.availableVersion.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); + break; + } + case 20: { + message.apiEndpoint = reader.string(); + break; + } + case 21: { + message.gcsBucket = reader.string(); + break; + } + case 22: { + if (!(message.accelerators && message.accelerators.length)) + message.accelerators = []; + message.accelerators.push($root.google.cloud.datafusion.v1beta1.Accelerator.decode(reader, reader.uint32())); + break; + } + case 23: { + message.p4ServiceAccount = reader.string(); + break; + } + case 24: { + message.tenantProjectId = reader.string(); + break; + } + case 25: { + message.dataprocServiceAccount = reader.string(); + break; + } + case 26: { + message.enableRbac = reader.bool(); + break; + } + case 27: { + message.cryptoKeyConfig = $root.google.cloud.datafusion.v1beta1.CryptoKeyConfig.decode(reader, reader.uint32()); + break; + } + case 28: { + if (!(message.disabledReason && message.disabledReason.length)) + message.disabledReason = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.disabledReason.push(reader.int32()); + } else + message.disabledReason.push(reader.int32()); + break; + } + default: + reader.skipType(tag & 7); break; } } @@ -7297,6 +7685,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.Instance + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Instance.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.Instance"; + }; + /** * Type enum. * @name google.cloud.datafusion.v1beta1.Instance.Type @@ -7500,21 +7903,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); - break; - case 5: - message.orderBy = reader.string(); - break; + case 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; @@ -7637,6 +8045,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListInstancesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListInstancesRequest"; + }; + return ListInstancesRequest; })(); @@ -7758,19 +8181,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.instances && message.instances.length)) - message.instances = []; - message.instances.push($root.google.cloud.datafusion.v1beta1.Instance.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; + case 1: { + if (!(message.instances && message.instances.length)) + message.instances = []; + message.instances.push($root.google.cloud.datafusion.v1beta1.Instance.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; @@ -7907,6 +8333,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListInstancesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListInstancesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -8035,18 +8476,22 @@ 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.latestPatchOnly = reader.bool(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.latestPatchOnly = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -8161,6 +8606,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAvailableVersionsRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAvailableVersionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest"; + }; + return ListAvailableVersionsRequest; })(); @@ -8269,14 +8729,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.availableVersions && message.availableVersions.length)) - message.availableVersions = []; - message.availableVersions.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.availableVersions && message.availableVersions.length)) + message.availableVersions = []; + message.availableVersions.push($root.google.cloud.datafusion.v1beta1.Version.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8392,6 +8854,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListAvailableVersionsResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListAvailableVersionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListAvailableVersionsResponse"; + }; + return ListAvailableVersionsResponse; })(); @@ -8487,9 +8964,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -8579,6 +9057,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.GetInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.GetInstanceRequest"; + }; + return GetInstanceRequest; })(); @@ -8696,15 +9189,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.instanceId = reader.string(); - break; - case 3: - message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.instanceId = reader.string(); + break; + } + case 3: { + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8816,6 +9312,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.CreateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -8911,9 +9422,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9003,6 +9515,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.DeleteInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -9109,12 +9636,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.instance = $root.google.cloud.datafusion.v1beta1.Instance.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -9223,6 +9752,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.UpdateInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -9318,9 +9862,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9410,6 +9955,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestartInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.RestartInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestartInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.RestartInstanceRequest"; + }; + return RestartInstanceRequest; })(); @@ -9505,9 +10065,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9597,6 +10158,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpgradeInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.UpgradeInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpgradeInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.UpgradeInstanceRequest"; + }; + return UpgradeInstanceRequest; })(); @@ -9758,27 +10334,34 @@ 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.statusDetail = reader.string(); - break; - case 6: - message.requestedCancellation = reader.bool(); - break; - case 7: - message.apiVersion = reader.string(); - break; + 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.statusDetail = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9927,6 +10510,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.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.datafusion.v1beta1.OperationMetadata"; + }; + return OperationMetadata; })(); @@ -10022,9 +10620,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.resource = reader.string(); - break; + case 1: { + message.resource = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10114,6 +10713,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RemoveIamPolicyRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveIamPolicyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest"; + }; + return RemoveIamPolicyRequest; })(); @@ -10274,6 +10888,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RemoveIamPolicyResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveIamPolicyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse"; + }; + return RemoveIamPolicyResponse; })(); @@ -10402,18 +11031,22 @@ 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.view = reader.int32(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.view = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -10546,8 +11179,23 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListNamespacesRequest; - })(); + /** + * Gets the default type url for ListNamespacesRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNamespacesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListNamespacesRequest"; + }; + + return ListNamespacesRequest; + })(); v1beta1.IAMPolicy = (function() { @@ -10652,12 +11300,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); - break; - case 2: - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; + case 1: { + message.policy = $root.google.iam.v1.Policy.decode(reader, reader.uint32()); + break; + } + case 2: { + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10766,6 +11416,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for IAMPolicy + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.IAMPolicy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + IAMPolicy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.IAMPolicy"; + }; + return IAMPolicy; })(); @@ -10872,12 +11537,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.iamPolicy = $root.google.cloud.datafusion.v1beta1.IAMPolicy.decode(reader, reader.uint32()); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.iamPolicy = $root.google.cloud.datafusion.v1beta1.IAMPolicy.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -10981,6 +11648,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Namespace + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.Namespace + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Namespace.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.Namespace"; + }; + return Namespace; })(); @@ -11089,14 +11771,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.namespaces && message.namespaces.length)) - message.namespaces = []; - message.namespaces.push($root.google.cloud.datafusion.v1beta1.Namespace.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.namespaces && message.namespaces.length)) + message.namespaces = []; + message.namespaces.push($root.google.cloud.datafusion.v1beta1.Namespace.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11212,6 +11896,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListNamespacesResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListNamespacesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListNamespacesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListNamespacesResponse"; + }; + return ListNamespacesResponse; })(); @@ -11351,21 +12050,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.zone = reader.string(); - break; - case 2: - message.domain = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.targetProject = reader.string(); - break; - case 5: - message.targetNetwork = reader.string(); - break; + case 1: { + message.zone = reader.string(); + break; + } + case 2: { + message.domain = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.targetProject = reader.string(); + break; + } + case 5: { + message.targetNetwork = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11488,6 +12192,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DnsPeering + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.DnsPeering + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DnsPeering.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.DnsPeering"; + }; + return DnsPeering; })(); @@ -11594,12 +12313,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.dnsPeering = $root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32()); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.dnsPeering = $root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11703,6 +12424,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AddDnsPeeringRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddDnsPeeringRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.AddDnsPeeringRequest"; + }; + return AddDnsPeeringRequest; })(); @@ -11863,6 +12599,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AddDnsPeeringResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.AddDnsPeeringResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AddDnsPeeringResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.AddDnsPeeringResponse"; + }; + return AddDnsPeeringResponse; })(); @@ -11985,12 +12736,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.zone = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12089,6 +12842,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RemoveDnsPeeringRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveDnsPeeringRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest"; + }; + return RemoveDnsPeeringRequest; })(); @@ -12249,6 +13017,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RemoveDnsPeeringResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RemoveDnsPeeringResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse"; + }; + return RemoveDnsPeeringResponse; })(); @@ -12366,15 +13149,18 @@ 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 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; @@ -12481,6 +13267,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListDnsPeeringsRequest + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsPeeringsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest"; + }; + return ListDnsPeeringsRequest; })(); @@ -12589,14 +13390,16 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.dnsPeerings && message.dnsPeerings.length)) - message.dnsPeerings = []; - message.dnsPeerings.push($root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; + case 1: { + if (!(message.dnsPeerings && message.dnsPeerings.length)) + message.dnsPeerings = []; + message.dnsPeerings.push($root.google.cloud.datafusion.v1beta1.DnsPeering.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -12712,6 +13515,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListDnsPeeringsResponse + * @function getTypeUrl + * @memberof google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDnsPeeringsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.datafusion.v1beta1.ListDnsPeeringsResponse"; + }; + return ListDnsPeeringsResponse; })(); @@ -12838,14 +13656,16 @@ 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; + 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; @@ -12961,6 +13781,21 @@ 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; })(); @@ -13171,38 +14006,48 @@ 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; + 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; @@ -13424,6 +14269,21 @@ 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; })(); @@ -13530,12 +14390,14 @@ 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; + case 1: { + message.kind = reader.string(); + break; + } + case 2: { + message.path = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -13634,6 +14496,21 @@ 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; })(); @@ -13828,41 +14705,48 @@ 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; - } - } + 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; }; @@ -14055,6 +14939,21 @@ 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 @@ -14191,12 +15090,14 @@ 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; + case 1: { + message.type = reader.string(); + break; + } + case 2: { + message.childType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -14295,6 +15196,21 @@ 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; })(); @@ -14404,11 +15320,12 @@ 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; + 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; @@ -14515,6 +15432,21 @@ 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; })(); @@ -14536,6 +15468,7 @@ * @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 */ /** @@ -14656,6 +15589,14 @@ */ 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 @@ -14711,6 +15652,8 @@ 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; }; @@ -14745,66 +15688,82 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -14916,6 +15875,9 @@ 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; }; @@ -15008,6 +15970,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -15039,6 +16003,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -15085,6 +16050,8 @@ } if (message.syntax != null && message.hasOwnProperty("syntax")) object.syntax = message.syntax; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = message.edition; return object; }; @@ -15099,6 +16066,21 @@ 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; })(); @@ -15309,52 +16291,62 @@ 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; + 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; @@ -15655,6 +16647,21 @@ 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() { /** @@ -15769,15 +16776,18 @@ 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; + 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; @@ -15889,6 +16899,21 @@ 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; })(); @@ -15995,12 +17020,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -16099,6 +17126,21 @@ 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; })(); @@ -16199,11 +17241,12 @@ 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; + 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; @@ -16310,6 +17353,21 @@ 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; })(); @@ -16515,41 +17573,52 @@ 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); + 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; } } @@ -16834,6 +17903,21 @@ 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 @@ -17002,12 +18086,14 @@ 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; + 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; @@ -17111,6 +18197,21 @@ 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; })(); @@ -17256,27 +18357,32 @@ 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; + 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; @@ -17452,6 +18558,21 @@ 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() { /** @@ -17555,12 +18676,14 @@ 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 1: { + message.start = reader.int32(); + break; + } + case 2: { + message.end = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -17659,6 +18782,21 @@ 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; })(); @@ -17779,15 +18917,18 @@ 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; + 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; @@ -17899,6 +19040,21 @@ 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; })(); @@ -18018,17 +19174,20 @@ 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; + 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; @@ -18158,6 +19317,21 @@ 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; })(); @@ -18308,24 +19482,30 @@ 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; + 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; @@ -18461,6 +19641,21 @@ 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; })(); @@ -18791,76 +19986,98 @@ 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; + 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; @@ -19173,6 +20390,21 @@ 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 @@ -19341,26 +20573,32 @@ 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; + 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; @@ -19514,6 +20752,21 @@ 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; })(); @@ -19527,6 +20780,7 @@ * @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 @@ -19584,12 +20838,20 @@ FieldOptions.prototype.lazy = false; /** - * FieldOptions deprecated. - * @member {boolean} deprecated + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy * @memberof google.protobuf.FieldOptions * @instance */ - FieldOptions.prototype.deprecated = false; + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; /** * FieldOptions weak. @@ -19659,6 +20921,8 @@ 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(); @@ -19704,42 +20968,55 @@ 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 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) + 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()); - } else - message[".google.api.fieldBehavior"].push(reader.int32()); - break; - case 1055: - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -19799,6 +21076,9 @@ 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"; @@ -19884,6 +21164,8 @@ } 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) @@ -19971,6 +21253,7 @@ 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")) @@ -19985,6 +21268,8 @@ object.jstype = options.enums === String ? $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) @@ -20011,6 +21296,21 @@ 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 @@ -20140,11 +21440,12 @@ 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; + 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; @@ -20251,6 +21552,21 @@ 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; })(); @@ -20370,17 +21686,20 @@ 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; + 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; @@ -20505,6 +21824,21 @@ 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; })(); @@ -20613,14 +21947,16 @@ 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; + 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; @@ -20736,6 +22072,21 @@ 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; })(); @@ -20866,20 +22217,24 @@ 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; + 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; @@ -21012,6 +22367,21 @@ 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; })(); @@ -21166,28 +22536,34 @@ 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; + 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; @@ -21377,6 +22753,21 @@ 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 @@ -21556,29 +22947,36 @@ 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; + 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; @@ -21691,7 +23089,7 @@ 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) + else if (object.stringValue.length >= 0) message.stringValue = object.stringValue; if (object.aggregateValue != null) message.aggregateValue = String(object.aggregateValue); @@ -21772,6 +23170,21 @@ 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() { /** @@ -21873,12 +23286,14 @@ 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; + case 1: { + message.namePart = reader.string(); + break; + } + case 2: { + message.isExtension = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -21979,6 +23394,21 @@ 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; })(); @@ -22079,11 +23509,12 @@ 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; + 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; @@ -22190,6 +23621,21 @@ 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() { /** @@ -22338,37 +23784,42 @@ 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) + 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()); - } 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) + 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()); - } 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; + 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; @@ -22529,6 +23980,21 @@ 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; })(); @@ -22629,11 +24095,12 @@ 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; + 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; @@ -22740,6 +24207,21 @@ 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() { /** @@ -22750,6 +24232,7 @@ * @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 */ /** @@ -22801,7 +24284,15 @@ Annotation.prototype.end = 0; /** - * Creates a new Annotation instance using the specified properties. + * 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 @@ -22836,6 +24327,8 @@ 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; }; @@ -22870,25 +24363,33 @@ 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) + 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()); - } 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; + 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; @@ -22940,6 +24441,15 @@ 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; }; @@ -22968,6 +24478,20 @@ message.begin = object.begin | 0; if (object.end != null) message.end = object.end | 0; + switch (object.semantic) { + 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; }; @@ -22990,6 +24514,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -23002,6 +24527,8 @@ 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] : message.semantic; return object; }; @@ -23016,6 +24543,37 @@ 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; })(); @@ -23125,12 +24683,14 @@ 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; + case 1: { + message.type_url = reader.string(); + break; + } + case 2: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -23192,7 +24752,7 @@ 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) + else if (object.value.length >= 0) message.value = object.value; return message; }; @@ -23238,6 +24798,21 @@ 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; })(); @@ -23344,12 +24919,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -23462,6 +25039,21 @@ 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; })(); @@ -23622,6 +25214,21 @@ 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; })(); @@ -23719,11 +25326,12 @@ 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; + case 1: { + if (!(message.paths && message.paths.length)) + message.paths = []; + message.paths.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -23825,6 +25433,21 @@ 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; })(); @@ -23931,12 +25554,14 @@ 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; + case 1: { + message.seconds = reader.int64(); + break; + } + case 2: { + message.nanos = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24049,6 +25674,21 @@ 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; })(); @@ -24097,7 +25737,7 @@ }; /** - * Callback as used by {@link google.longrunning.Operations#listOperations}. + * Callback as used by {@link google.longrunning.Operations|listOperations}. * @memberof google.longrunning.Operations * @typedef ListOperationsCallback * @type {function} @@ -24130,7 +25770,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#getOperation}. + * Callback as used by {@link google.longrunning.Operations|getOperation}. * @memberof google.longrunning.Operations * @typedef GetOperationCallback * @type {function} @@ -24163,7 +25803,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#deleteOperation}. + * Callback as used by {@link google.longrunning.Operations|deleteOperation}. * @memberof google.longrunning.Operations * @typedef DeleteOperationCallback * @type {function} @@ -24196,7 +25836,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#cancelOperation}. + * Callback as used by {@link google.longrunning.Operations|cancelOperation}. * @memberof google.longrunning.Operations * @typedef CancelOperationCallback * @type {function} @@ -24229,7 +25869,7 @@ */ /** - * Callback as used by {@link google.longrunning.Operations#waitOperation}. + * Callback as used by {@link google.longrunning.Operations|waitOperation}. * @memberof google.longrunning.Operations * @typedef WaitOperationCallback * @type {function} @@ -24414,21 +26054,26 @@ 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; + 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; @@ -24579,6 +26224,21 @@ 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; })(); @@ -24674,9 +26334,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24766,6 +26427,21 @@ 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; })(); @@ -24894,18 +26570,22 @@ 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; + 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; @@ -25020,6 +26700,21 @@ 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; })(); @@ -25128,14 +26823,16 @@ 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; + 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; @@ -25251,6 +26948,21 @@ 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; })(); @@ -25346,9 +27058,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25438,6 +27151,21 @@ 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; })(); @@ -25533,9 +27261,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -25625,6 +27354,21 @@ 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; })(); @@ -25731,12 +27475,14 @@ 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; + 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; @@ -25840,6 +27586,21 @@ 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; })(); @@ -25946,12 +27707,14 @@ 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; + case 1: { + message.responseType = reader.string(); + break; + } + case 2: { + message.metadataType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -26050,6 +27813,21 @@ 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; })(); @@ -26181,17 +27959,20 @@ 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; + 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; @@ -26316,6 +28097,21 @@ 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; })(); @@ -26348,6 +28144,7 @@ * @interface IPolicy * @property {number|null} [version] Policy version * @property {Array.|null} [bindings] Policy bindings + * @property {Array.|null} [auditConfigs] Policy auditConfigs * @property {Uint8Array|null} [etag] Policy etag */ @@ -26361,6 +28158,7 @@ */ function Policy(properties) { this.bindings = []; + this.auditConfigs = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -26383,6 +28181,14 @@ */ Policy.prototype.bindings = $util.emptyArray; + /** + * Policy auditConfigs. + * @member {Array.} auditConfigs + * @memberof google.iam.v1.Policy + * @instance + */ + Policy.prototype.auditConfigs = $util.emptyArray; + /** * Policy etag. * @member {Uint8Array} etag @@ -26422,6 +28228,9 @@ if (message.bindings != null && message.bindings.length) for (var i = 0; i < message.bindings.length; ++i) $root.google.iam.v1.Binding.encode(message.bindings[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.auditConfigs != null && message.auditConfigs.length) + for (var i = 0; i < message.auditConfigs.length; ++i) + $root.google.iam.v1.AuditConfig.encode(message.auditConfigs[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; @@ -26456,17 +28265,26 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.version = reader.int32(); - break; - case 4: - if (!(message.bindings && message.bindings.length)) - message.bindings = []; - message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); - break; - case 3: - message.etag = reader.bytes(); - break; + case 1: { + message.version = reader.int32(); + break; + } + case 4: { + if (!(message.bindings && message.bindings.length)) + message.bindings = []; + message.bindings.push($root.google.iam.v1.Binding.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.auditConfigs && message.auditConfigs.length)) + message.auditConfigs = []; + message.auditConfigs.push($root.google.iam.v1.AuditConfig.decode(reader, reader.uint32())); + break; + } + case 3: { + message.etag = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -26514,6 +28332,15 @@ return "bindings." + error; } } + if (message.auditConfigs != null && message.hasOwnProperty("auditConfigs")) { + if (!Array.isArray(message.auditConfigs)) + return "auditConfigs: array expected"; + for (var i = 0; i < message.auditConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditConfig.verify(message.auditConfigs[i]); + if (error) + return "auditConfigs." + error; + } + } if (message.etag != null && message.hasOwnProperty("etag")) if (!(message.etag && typeof message.etag.length === "number" || $util.isString(message.etag))) return "etag: buffer expected"; @@ -26544,10 +28371,20 @@ message.bindings[i] = $root.google.iam.v1.Binding.fromObject(object.bindings[i]); } } + if (object.auditConfigs) { + if (!Array.isArray(object.auditConfigs)) + throw TypeError(".google.iam.v1.Policy.auditConfigs: array expected"); + message.auditConfigs = []; + for (var i = 0; i < object.auditConfigs.length; ++i) { + if (typeof object.auditConfigs[i] !== "object") + throw TypeError(".google.iam.v1.Policy.auditConfigs: object expected"); + message.auditConfigs[i] = $root.google.iam.v1.AuditConfig.fromObject(object.auditConfigs[i]); + } + } if (object.etag != null) if (typeof object.etag === "string") $util.base64.decode(object.etag, message.etag = $util.newBuffer($util.base64.length(object.etag)), 0); - else if (object.etag.length) + else if (object.etag.length >= 0) message.etag = object.etag; return message; }; @@ -26565,8 +28402,10 @@ if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) + if (options.arrays || options.defaults) { object.bindings = []; + object.auditConfigs = []; + } if (options.defaults) { object.version = 0; if (options.bytes === String) @@ -26586,6 +28425,11 @@ for (var j = 0; j < message.bindings.length; ++j) object.bindings[j] = $root.google.iam.v1.Binding.toObject(message.bindings[j], options); } + if (message.auditConfigs && message.auditConfigs.length) { + object.auditConfigs = []; + for (var j = 0; j < message.auditConfigs.length; ++j) + object.auditConfigs[j] = $root.google.iam.v1.AuditConfig.toObject(message.auditConfigs[j], options); + } return object; }; @@ -26600,6 +28444,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Policy + * @function getTypeUrl + * @memberof google.iam.v1.Policy + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Policy.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Policy"; + }; + return Policy; })(); @@ -26719,17 +28578,20 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.role = reader.string(); - break; - case 2: - if (!(message.members && message.members.length)) - message.members = []; - message.members.push(reader.string()); - break; - case 3: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.role = reader.string(); + break; + } + case 2: { + if (!(message.members && message.members.length)) + message.members = []; + message.members.push(reader.string()); + break; + } + case 3: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -26854,9 +28716,556 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Binding + * @function getTypeUrl + * @memberof google.iam.v1.Binding + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Binding.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.Binding"; + }; + return Binding; })(); + v1.AuditConfig = (function() { + + /** + * Properties of an AuditConfig. + * @memberof google.iam.v1 + * @interface IAuditConfig + * @property {string|null} [service] AuditConfig service + * @property {Array.|null} [auditLogConfigs] AuditConfig auditLogConfigs + */ + + /** + * Constructs a new AuditConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditConfig. + * @implements IAuditConfig + * @constructor + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + */ + function AuditConfig(properties) { + this.auditLogConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditConfig service. + * @member {string} service + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.service = ""; + + /** + * AuditConfig auditLogConfigs. + * @member {Array.} auditLogConfigs + * @memberof google.iam.v1.AuditConfig + * @instance + */ + AuditConfig.prototype.auditLogConfigs = $util.emptyArray; + + /** + * Creates a new AuditConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditConfig} AuditConfig instance + */ + AuditConfig.create = function create(properties) { + return new AuditConfig(properties); + }; + + /** + * Encodes the specified AuditConfig message. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.service != null && Object.hasOwnProperty.call(message, "service")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.service); + if (message.auditLogConfigs != null && message.auditLogConfigs.length) + for (var i = 0; i < message.auditLogConfigs.length; ++i) + $root.google.iam.v1.AuditLogConfig.encode(message.auditLogConfigs[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AuditConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.IAuditConfig} message AuditConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.service = reader.string(); + break; + } + case 3: { + if (!(message.auditLogConfigs && message.auditLogConfigs.length)) + message.auditLogConfigs = []; + message.auditLogConfigs.push($root.google.iam.v1.AuditLogConfig.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditConfig} AuditConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditConfig message. + * @function verify + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.service != null && message.hasOwnProperty("service")) + if (!$util.isString(message.service)) + return "service: string expected"; + if (message.auditLogConfigs != null && message.hasOwnProperty("auditLogConfigs")) { + if (!Array.isArray(message.auditLogConfigs)) + return "auditLogConfigs: array expected"; + for (var i = 0; i < message.auditLogConfigs.length; ++i) { + var error = $root.google.iam.v1.AuditLogConfig.verify(message.auditLogConfigs[i]); + if (error) + return "auditLogConfigs." + error; + } + } + return null; + }; + + /** + * Creates an AuditConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditConfig} AuditConfig + */ + AuditConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditConfig) + return object; + var message = new $root.google.iam.v1.AuditConfig(); + if (object.service != null) + message.service = String(object.service); + if (object.auditLogConfigs) { + if (!Array.isArray(object.auditLogConfigs)) + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: array expected"); + message.auditLogConfigs = []; + for (var i = 0; i < object.auditLogConfigs.length; ++i) { + if (typeof object.auditLogConfigs[i] !== "object") + throw TypeError(".google.iam.v1.AuditConfig.auditLogConfigs: object expected"); + message.auditLogConfigs[i] = $root.google.iam.v1.AuditLogConfig.fromObject(object.auditLogConfigs[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AuditConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditConfig + * @static + * @param {google.iam.v1.AuditConfig} message AuditConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.auditLogConfigs = []; + if (options.defaults) + object.service = ""; + if (message.service != null && message.hasOwnProperty("service")) + object.service = message.service; + if (message.auditLogConfigs && message.auditLogConfigs.length) { + object.auditLogConfigs = []; + for (var j = 0; j < message.auditLogConfigs.length; ++j) + object.auditLogConfigs[j] = $root.google.iam.v1.AuditLogConfig.toObject(message.auditLogConfigs[j], options); + } + return object; + }; + + /** + * Converts this AuditConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditConfig + * @instance + * @returns {Object.} JSON object + */ + AuditConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfig"; + }; + + return AuditConfig; + })(); + + v1.AuditLogConfig = (function() { + + /** + * Properties of an AuditLogConfig. + * @memberof google.iam.v1 + * @interface IAuditLogConfig + * @property {google.iam.v1.AuditLogConfig.LogType|null} [logType] AuditLogConfig logType + * @property {Array.|null} [exemptedMembers] AuditLogConfig exemptedMembers + */ + + /** + * Constructs a new AuditLogConfig. + * @memberof google.iam.v1 + * @classdesc Represents an AuditLogConfig. + * @implements IAuditLogConfig + * @constructor + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + */ + function AuditLogConfig(properties) { + this.exemptedMembers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AuditLogConfig logType. + * @member {google.iam.v1.AuditLogConfig.LogType} logType + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.logType = 0; + + /** + * AuditLogConfig exemptedMembers. + * @member {Array.} exemptedMembers + * @memberof google.iam.v1.AuditLogConfig + * @instance + */ + AuditLogConfig.prototype.exemptedMembers = $util.emptyArray; + + /** + * Creates a new AuditLogConfig instance using the specified properties. + * @function create + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig=} [properties] Properties to set + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig instance + */ + AuditLogConfig.create = function create(properties) { + return new AuditLogConfig(properties); + }; + + /** + * Encodes the specified AuditLogConfig message. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.logType != null && Object.hasOwnProperty.call(message, "logType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.logType); + if (message.exemptedMembers != null && message.exemptedMembers.length) + for (var i = 0; i < message.exemptedMembers.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.exemptedMembers[i]); + return writer; + }; + + /** + * Encodes the specified AuditLogConfig message, length delimited. Does not implicitly {@link google.iam.v1.AuditLogConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.IAuditLogConfig} message AuditLogConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AuditLogConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer. + * @function decode + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.iam.v1.AuditLogConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.logType = reader.int32(); + break; + } + case 2: { + if (!(message.exemptedMembers && message.exemptedMembers.length)) + message.exemptedMembers = []; + message.exemptedMembers.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AuditLogConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AuditLogConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AuditLogConfig message. + * @function verify + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AuditLogConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.logType != null && message.hasOwnProperty("logType")) + switch (message.logType) { + default: + return "logType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.exemptedMembers != null && message.hasOwnProperty("exemptedMembers")) { + if (!Array.isArray(message.exemptedMembers)) + return "exemptedMembers: array expected"; + for (var i = 0; i < message.exemptedMembers.length; ++i) + if (!$util.isString(message.exemptedMembers[i])) + return "exemptedMembers: string[] expected"; + } + return null; + }; + + /** + * Creates an AuditLogConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {Object.} object Plain object + * @returns {google.iam.v1.AuditLogConfig} AuditLogConfig + */ + AuditLogConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.iam.v1.AuditLogConfig) + return object; + var message = new $root.google.iam.v1.AuditLogConfig(); + switch (object.logType) { + case "LOG_TYPE_UNSPECIFIED": + case 0: + message.logType = 0; + break; + case "ADMIN_READ": + case 1: + message.logType = 1; + break; + case "DATA_WRITE": + case 2: + message.logType = 2; + break; + case "DATA_READ": + case 3: + message.logType = 3; + break; + } + if (object.exemptedMembers) { + if (!Array.isArray(object.exemptedMembers)) + throw TypeError(".google.iam.v1.AuditLogConfig.exemptedMembers: array expected"); + message.exemptedMembers = []; + for (var i = 0; i < object.exemptedMembers.length; ++i) + message.exemptedMembers[i] = String(object.exemptedMembers[i]); + } + return message; + }; + + /** + * Creates a plain object from an AuditLogConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {google.iam.v1.AuditLogConfig} message AuditLogConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AuditLogConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.exemptedMembers = []; + if (options.defaults) + object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; + if (message.logType != null && message.hasOwnProperty("logType")) + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + if (message.exemptedMembers && message.exemptedMembers.length) { + object.exemptedMembers = []; + for (var j = 0; j < message.exemptedMembers.length; ++j) + object.exemptedMembers[j] = message.exemptedMembers[j]; + } + return object; + }; + + /** + * Converts this AuditLogConfig to JSON. + * @function toJSON + * @memberof google.iam.v1.AuditLogConfig + * @instance + * @returns {Object.} JSON object + */ + AuditLogConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AuditLogConfig + * @function getTypeUrl + * @memberof google.iam.v1.AuditLogConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditLogConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditLogConfig"; + }; + + /** + * LogType enum. + * @name google.iam.v1.AuditLogConfig.LogType + * @enum {number} + * @property {number} LOG_TYPE_UNSPECIFIED=0 LOG_TYPE_UNSPECIFIED value + * @property {number} ADMIN_READ=1 ADMIN_READ value + * @property {number} DATA_WRITE=2 DATA_WRITE value + * @property {number} DATA_READ=3 DATA_READ value + */ + AuditLogConfig.LogType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LOG_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ADMIN_READ"] = 1; + values[valuesById[2] = "DATA_WRITE"] = 2; + values[valuesById[3] = "DATA_READ"] = 3; + return values; + })(); + + return AuditLogConfig; + })(); + v1.PolicyDelta = (function() { /** @@ -26964,16 +29373,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.bindingDeltas && message.bindingDeltas.length)) - message.bindingDeltas = []; - message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) - message.auditConfigDeltas = []; - message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); - break; + case 1: { + if (!(message.bindingDeltas && message.bindingDeltas.length)) + message.bindingDeltas = []; + message.bindingDeltas.push($root.google.iam.v1.BindingDelta.decode(reader, reader.uint32())); + break; + } + case 2: { + if (!(message.auditConfigDeltas && message.auditConfigDeltas.length)) + message.auditConfigDeltas = []; + message.auditConfigDeltas.push($root.google.iam.v1.AuditConfigDelta.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -27106,6 +29517,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for PolicyDelta + * @function getTypeUrl + * @memberof google.iam.v1.PolicyDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PolicyDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.PolicyDelta"; + }; + return PolicyDelta; })(); @@ -27234,18 +29660,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.role = reader.string(); - break; - case 3: - message.member = reader.string(); - break; - case 4: - message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.role = reader.string(); + break; + } + case 3: { + message.member = reader.string(); + break; + } + case 4: { + message.condition = $root.google.type.Expr.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -27383,6 +29813,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BindingDelta + * @function getTypeUrl + * @memberof google.iam.v1.BindingDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BindingDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.BindingDelta"; + }; + /** * Action enum. * @name google.iam.v1.BindingDelta.Action @@ -27527,18 +29972,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.action = reader.int32(); - break; - case 2: - message.service = reader.string(); - break; - case 3: - message.exemptedMember = reader.string(); - break; - case 4: - message.logType = reader.string(); - break; + case 1: { + message.action = reader.int32(); + break; + } + case 2: { + message.service = reader.string(); + break; + } + case 3: { + message.exemptedMember = reader.string(); + break; + } + case 4: { + message.logType = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27671,6 +30120,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for AuditConfigDelta + * @function getTypeUrl + * @memberof google.iam.v1.AuditConfigDelta + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AuditConfigDelta.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.iam.v1.AuditConfigDelta"; + }; + /** * Action enum. * @name google.iam.v1.AuditConfigDelta.Action @@ -27830,18 +30294,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.expression = reader.string(); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.location = reader.string(); - break; + case 1: { + message.expression = reader.string(); + break; + } + case 2: { + message.title = reader.string(); + break; + } + case 3: { + message.description = reader.string(); + break; + } + case 4: { + message.location = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -27956,6 +30424,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Expr + * @function getTypeUrl + * @memberof google.type.Expr + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Expr.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.type.Expr"; + }; + return Expr; })(); diff --git a/packages/google-cloud-datafusion/protos/protos.json b/packages/google-cloud-datafusion/protos/protos.json index 8391a877591..c0a470b2202 100644 --- a/packages/google-cloud-datafusion/protos/protos.json +++ b/packages/google-cloud-datafusion/protos/protos.json @@ -1907,6 +1907,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2435,6 +2439,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2727,6 +2738,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } @@ -3051,6 +3075,11 @@ "type": "Binding", "id": 4 }, + "auditConfigs": { + "rule": "repeated", + "type": "AuditConfig", + "id": 6 + }, "etag": { "type": "bytes", "id": 3 @@ -3074,6 +3103,42 @@ } } }, + "AuditConfig": { + "fields": { + "service": { + "type": "string", + "id": 1 + }, + "auditLogConfigs": { + "rule": "repeated", + "type": "AuditLogConfig", + "id": 3 + } + } + }, + "AuditLogConfig": { + "fields": { + "logType": { + "type": "LogType", + "id": 1 + }, + "exemptedMembers": { + "rule": "repeated", + "type": "string", + "id": 2 + } + }, + "nested": { + "LogType": { + "values": { + "LOG_TYPE_UNSPECIFIED": 0, + "ADMIN_READ": 1, + "DATA_WRITE": 2, + "DATA_READ": 3 + } + } + } + }, "PolicyDelta": { "fields": { "bindingDeltas": { From 3f6f19242fbfcb5327adde4a7d2d17560dce9909 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Sat, 27 Aug 2022 04:58:24 +0000 Subject: [PATCH 38/47] fix: do not import the whole google-gax from proto JS (#1553) (#65) fix: use google-gax v3.3.0 Source-Link: https://github.com/googleapis/synthtool/commit/c73d112a11a1f1a93efa67c50495c19aa3a88910 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:b15a6f06cc06dcffa11e1bebdf1a74b6775a134aac24a0f86f51ddf728eb373e --- packages/google-cloud-datafusion/package.json | 2 +- packages/google-cloud-datafusion/protos/protos.d.ts | 2 +- packages/google-cloud-datafusion/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index c85aa5b1918..3baa42eeed7 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -39,7 +39,7 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index 72bd8baf8e6..5df538a36dd 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -13,7 +13,7 @@ // limitations under the License. import Long = require("long"); -import {protobuf as $protobuf} from "google-gax"; +import type {protobuf as $protobuf} from "google-gax"; /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index 70e18ef16b8..89a6b5520de 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -19,7 +19,7 @@ define(["protobufjs/minimal"], factory); /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) - module.exports = factory(require("google-gax").protobufMinimal); + module.exports = factory(require("google-gax/build/src/protobuf").protobufMinimal); })(this, function($protobuf) { "use strict"; From ce90a402645597c7a405fcb97e81549b7680057a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 1 Sep 2022 21:00:18 +0000 Subject: [PATCH 39/47] fix: allow passing gax instance to client constructor (#66) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 470911839 Source-Link: https://github.com/googleapis/googleapis/commit/352756699ebc5b2144c252867c265ea44448712e Source-Link: https://github.com/googleapis/googleapis-gen/commit/f16a1d224f00a630ea43d6a9a1a31f566f45cdea Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjE2YTFkMjI0ZjAwYTYzMGVhNDNkNmE5YTFhMzFmNTY2ZjQ1Y2RlYSJ9 feat: accept google-gax instance as a parameter Please see the documentation of the client constructor for details. PiperOrigin-RevId: 470332808 Source-Link: https://github.com/googleapis/googleapis/commit/d4a23675457cd8f0b44080e0594ec72de1291b89 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e97a1ac204ead4fe7341f91e72db7c6ac6016341 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTk3YTFhYzIwNGVhZDRmZTczNDFmOTFlNzJkYjdjNmFjNjAxNjM0MSJ9 --- .../src/v1/data_fusion_client.ts | 85 +++++++------ .../src/v1beta1/data_fusion_client.ts | 114 ++++++++++-------- 2 files changed, 117 insertions(+), 82 deletions(-) diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index bcd50348599..a2defdc9b9a 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './data_fusion_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -101,8 +99,18 @@ export class DataFusionClient { * 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 DataFusionClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DataFusionClient; const servicePath = @@ -122,8 +130,13 @@ export class DataFusionClient { 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 ? gax.fallback : 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); @@ -311,7 +324,7 @@ export class DataFusionClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -520,7 +533,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -629,7 +642,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -655,11 +668,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings() @@ -767,7 +781,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -793,11 +807,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings() @@ -913,7 +928,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'instance.name': request.instance!.name || '', }); this.initialize(); @@ -939,11 +954,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1052,7 +1068,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1078,11 +1094,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1191,7 +1208,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1235,7 +1252,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; @@ -1288,7 +1305,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; @@ -1400,7 +1417,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1446,7 +1463,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; @@ -1501,7 +1518,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index 47ae1a252ae..c918664b0ba 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -17,8 +17,8 @@ // ** All changes to this file may be overwritten. ** /* global window */ -import * as gax from 'google-gax'; -import { +import type * as gax from 'google-gax'; +import type { Callback, CallOptions, Descriptors, @@ -28,7 +28,6 @@ import { PaginationCallback, GaxCall, } from 'google-gax'; - import {Transform} from 'stream'; import * as protos from '../../protos/protos'; import jsonProtos = require('../../protos/protos.json'); @@ -38,7 +37,6 @@ import jsonProtos = require('../../protos/protos.json'); * This file defines retry strategy and timeouts for all API methods in this library. */ import * as gapicConfig from './data_fusion_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -101,8 +99,18 @@ export class DataFusionClient { * 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 DataFusionClient({fallback: 'rest'}, gax); + * ``` */ - constructor(opts?: ClientOptions) { + constructor( + opts?: ClientOptions, + gaxInstance?: typeof gax | typeof gax.fallback + ) { // Ensure that options include all the required fields. const staticMembers = this.constructor as typeof DataFusionClient; const servicePath = @@ -122,8 +130,13 @@ export class DataFusionClient { 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 ? gax.fallback : 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); @@ -352,7 +365,7 @@ export class DataFusionClient { this.innerApiCalls = {}; // Add a warn function to the client constructor so it can be easily tested. - this.warn = gax.warn; + this.warn = this._gaxModule.warn; } /** @@ -573,7 +586,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -670,7 +683,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ resource: request.resource || '', }); this.initialize(); @@ -763,7 +776,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -862,7 +875,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -971,7 +984,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -997,11 +1010,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.createInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1109,7 +1123,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1135,11 +1149,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1255,7 +1270,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'instance.name': request.instance!.name || '', }); this.initialize(); @@ -1281,11 +1296,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.updateInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1394,7 +1410,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1420,11 +1436,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.restartInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1535,7 +1552,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ name: request.name || '', }); this.initialize(); @@ -1561,11 +1578,12 @@ export class DataFusionClient { protos.google.cloud.datafusion.v1beta1.OperationMetadata > > { - const request = new operationsProtos.google.longrunning.GetOperationRequest( - {name} - ); + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); const [operation] = await this.operationsClient.getOperation(request); - const decodeOperation = new gax.Operation( + const decodeOperation = new this._gaxModule.Operation( operation, this.descriptors.longrunning.upgradeInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1674,7 +1692,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1718,7 +1736,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; @@ -1771,7 +1789,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; @@ -1883,7 +1901,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -1929,7 +1947,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; @@ -1984,7 +2002,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listInstances']; @@ -2094,7 +2112,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2138,7 +2156,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNamespaces']; @@ -2191,7 +2209,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listNamespaces']; @@ -2296,7 +2314,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); this.initialize(); @@ -2335,7 +2353,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listDnsPeerings']; @@ -2383,7 +2401,7 @@ export class DataFusionClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ parent: request.parent || '', }); const defaultCallSettings = this._defaults['listDnsPeerings']; From 0060909dbdc2e31ae80275a9cae7f127e4facaf2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:51:16 -0400 Subject: [PATCH 40/47] chore(main): release 2.1.1 (#63) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(main): release 2.1.1 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> Co-authored-by: Owl Bot --- packages/google-cloud-datafusion/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-datafusion/package.json | 2 +- .../snippet_metadata.google.cloud.datafusion.v1.json | 2 +- ...ppet_metadata.google.cloud.datafusion.v1beta1.json | 2 +- packages/google-cloud-datafusion/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md index c187730ab55..cce958c5615 100644 --- a/packages/google-cloud-datafusion/CHANGELOG.md +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.1.1](https://github.com/googleapis/nodejs-data-fusion/compare/v2.1.0...v2.1.1) (2022-09-01) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#66](https://github.com/googleapis/nodejs-data-fusion/issues/66)) ([42a24b7](https://github.com/googleapis/nodejs-data-fusion/commit/42a24b79cd87fed6cb480edf9e10ab72b6d63aba)) +* Better support for fallback mode ([#61](https://github.com/googleapis/nodejs-data-fusion/issues/61)) ([0098350](https://github.com/googleapis/nodejs-data-fusion/commit/0098350779b5f2d26d4385c44981ebe2a2ba1d17)) +* Change import long to require ([#62](https://github.com/googleapis/nodejs-data-fusion/issues/62)) ([b284743](https://github.com/googleapis/nodejs-data-fusion/commit/b284743fe36fa68aa5fe47f09dece179ad9915d4)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-data-fusion/issues/1553)) ([#65](https://github.com/googleapis/nodejs-data-fusion/issues/65)) ([5a66df0](https://github.com/googleapis/nodejs-data-fusion/commit/5a66df00bce6554e077cc554867cd5f4289681b4)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-data-fusion/issues/1546)) ([#64](https://github.com/googleapis/nodejs-data-fusion/issues/64)) ([428bfd4](https://github.com/googleapis/nodejs-data-fusion/commit/428bfd495a60857a1c5fc8b4f5e57c67d598b8cf)) + ## [2.1.0](https://github.com/googleapis/nodejs-data-fusion/compare/v2.0.0...v2.1.0) (2022-06-30) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 3baa42eeed7..6c34445e095 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "2.1.0", + "version": "2.1.1", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index fb26208fbbf..6bfafa0aada 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.1.0", + "version": "2.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index 4bf253ad326..6a8159f570d 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.1.0", + "version": "2.1.1", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index bed42769ea5..db77e8773a4 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^2.1.0" + "@google-cloud/data-fusion": "^2.1.1" }, "devDependencies": { "c8": "^7.1.0", From 62a94e08737e4c28e7289a74cd33bcb01210f80c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:34:25 +0000 Subject: [PATCH 41/47] fix: preserve default values in x-goog-request-params header (#67) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 474338479 Source-Link: https://github.com/googleapis/googleapis/commit/d5d35e0353b59719e8917103b1bc7df2782bf6ba Source-Link: https://github.com/googleapis/googleapis-gen/commit/efcd3f93962a103f68f003e2a1eecde6fa216a27 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWZjZDNmOTM5NjJhMTAzZjY4ZjAwM2UyYTFlZWNkZTZmYTIxNmEyNyJ9 --- .../src/v1/data_fusion_client.ts | 22 +- .../src/v1beta1/data_fusion_client.ts | 42 +- .../test/gapic_data_fusion_v1.ts | 842 ++++----- .../test/gapic_data_fusion_v1beta1.ts | 1514 +++++++++-------- 4 files changed, 1257 insertions(+), 1163 deletions(-) diff --git a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts index a2defdc9b9a..6ae0c83c0b8 100644 --- a/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1/data_fusion_client.ts @@ -534,7 +534,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); @@ -643,7 +643,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); @@ -782,7 +782,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); @@ -929,7 +929,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', + 'instance.name': request.instance!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); @@ -1069,7 +1069,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.restartInstance(request, options, callback); @@ -1209,7 +1209,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAvailableVersions(request, options, callback); @@ -1253,7 +1253,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1306,7 +1306,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1418,7 +1418,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listInstances(request, options, callback); @@ -1464,7 +1464,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); @@ -1519,7 +1519,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts index c918664b0ba..a0b19213ba7 100644 --- a/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts +++ b/packages/google-cloud-datafusion/src/v1beta1/data_fusion_client.ts @@ -587,7 +587,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); @@ -684,7 +684,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - resource: request.resource || '', + resource: request.resource ?? '', }); this.initialize(); return this.innerApiCalls.removeIamPolicy(request, options, callback); @@ -777,7 +777,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.addDnsPeering(request, options, callback); @@ -876,7 +876,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.removeDnsPeering(request, options, callback); @@ -985,7 +985,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.createInstance(request, options, callback); @@ -1124,7 +1124,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.deleteInstance(request, options, callback); @@ -1271,7 +1271,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'instance.name': request.instance!.name || '', + 'instance.name': request.instance!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateInstance(request, options, callback); @@ -1411,7 +1411,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.restartInstance(request, options, callback); @@ -1553,7 +1553,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - name: request.name || '', + name: request.name ?? '', }); this.initialize(); return this.innerApiCalls.upgradeInstance(request, options, callback); @@ -1693,7 +1693,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listAvailableVersions(request, options, callback); @@ -1737,7 +1737,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1790,7 +1790,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listAvailableVersions']; const callSettings = defaultCallSettings.merge(options); @@ -1902,7 +1902,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listInstances(request, options, callback); @@ -1948,7 +1948,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); @@ -2003,7 +2003,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); @@ -2113,7 +2113,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listNamespaces(request, options, callback); @@ -2157,7 +2157,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNamespaces']; const callSettings = defaultCallSettings.merge(options); @@ -2210,7 +2210,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listNamespaces']; const callSettings = defaultCallSettings.merge(options); @@ -2315,7 +2315,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); this.initialize(); return this.innerApiCalls.listDnsPeerings(request, options, callback); @@ -2354,7 +2354,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDnsPeerings']; const callSettings = defaultCallSettings.merge(options); @@ -2402,7 +2402,7 @@ export class DataFusionClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent || '', + parent: request.parent ?? '', }); const defaultCallSettings = this._defaults['listDnsPeerings']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index b4c6ba64fab..068d1b7fe5a 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -252,26 +267,23 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1.Instance() ); client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); const [response] = await client.getInstance(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance without error using callback', async () => { @@ -283,15 +295,9 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1.Instance() ); @@ -314,11 +320,14 @@ describe('v1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance with error', async () => { @@ -330,26 +339,23 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getInstance(request), expectedError); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance with closed client', async () => { @@ -361,7 +367,8 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -378,15 +385,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -395,11 +398,14 @@ describe('v1.DataFusionClient', () => { const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance without error using callback', async () => { @@ -411,15 +417,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -449,11 +451,14 @@ describe('v1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance with call error', async () => { @@ -465,26 +470,25 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createInstance(request), expectedError); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance with LRO error', async () => { @@ -496,15 +500,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -513,11 +513,14 @@ describe('v1.DataFusionClient', () => { ); const [operation] = await client.createInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateInstanceProgress without error', async () => { @@ -572,15 +575,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -589,11 +588,14 @@ describe('v1.DataFusionClient', () => { const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance without error using callback', async () => { @@ -605,15 +607,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -643,11 +641,14 @@ describe('v1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance with call error', async () => { @@ -659,26 +660,25 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteInstance(request), expectedError); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance with LRO error', async () => { @@ -690,15 +690,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -707,11 +703,14 @@ describe('v1.DataFusionClient', () => { ); const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteInstanceProgress without error', async () => { @@ -766,16 +765,13 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -784,11 +780,14 @@ describe('v1.DataFusionClient', () => { const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance without error using callback', async () => { @@ -800,16 +799,13 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -839,11 +835,14 @@ describe('v1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance with call error', async () => { @@ -855,27 +854,27 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateInstance(request), expectedError); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance with LRO error', async () => { @@ -887,16 +886,13 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -905,11 +901,14 @@ describe('v1.DataFusionClient', () => { ); const [operation] = await client.updateInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateInstanceProgress without error', async () => { @@ -964,15 +963,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -981,11 +976,14 @@ describe('v1.DataFusionClient', () => { const [operation] = await client.restartInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance without error using callback', async () => { @@ -997,15 +995,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1035,11 +1029,14 @@ describe('v1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance with call error', async () => { @@ -1051,26 +1048,25 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.restartInstance(request), expectedError); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance with LRO error', async () => { @@ -1082,15 +1078,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -1099,11 +1091,14 @@ describe('v1.DataFusionClient', () => { ); const [operation] = await client.restartInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRestartInstanceProgress without error', async () => { @@ -1158,15 +1153,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), @@ -1176,11 +1168,14 @@ describe('v1.DataFusionClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listAvailableVersions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersions without error using callback', async () => { @@ -1192,15 +1187,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), @@ -1225,11 +1217,14 @@ describe('v1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersions with error', async () => { @@ -1241,15 +1236,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAvailableVersions = stubSimpleCall( undefined, @@ -1259,11 +1251,14 @@ describe('v1.DataFusionClient', () => { client.listAvailableVersions(request), expectedError ); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersionsStream without error', async () => { @@ -1275,8 +1270,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), @@ -1310,12 +1309,15 @@ describe('v1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAvailableVersions, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1328,8 +1330,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1358,12 +1364,15 @@ describe('v1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAvailableVersions, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1376,8 +1385,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Version()), @@ -1398,12 +1411,15 @@ describe('v1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1416,8 +1432,12 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1435,12 +1455,15 @@ describe('v1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -1455,15 +1478,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), @@ -1472,11 +1491,14 @@ describe('v1.DataFusionClient', () => { client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); const [response] = await client.listInstances(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstances without error using callback', async () => { @@ -1488,15 +1510,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), @@ -1521,11 +1539,14 @@ describe('v1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstances with error', async () => { @@ -1537,26 +1558,25 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listInstances(request), expectedError); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstancesStream without error', async () => { @@ -1568,8 +1588,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), @@ -1600,11 +1623,12 @@ describe('v1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listInstances, request) ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1617,8 +1641,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1644,11 +1671,12 @@ describe('v1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listInstances, request) ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1661,8 +1689,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), generateSampleMessage(new protos.google.cloud.datafusion.v1.Instance()), @@ -1682,11 +1713,12 @@ describe('v1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1699,8 +1731,11 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -1717,11 +1752,12 @@ describe('v1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index 594515b3ba5..739d1096055 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -27,6 +27,21 @@ import {PassThrough} from 'stream'; import {protobuf, LROperation, operationsProtos} from 'google-gax'; +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON( + require('../protos/protos.json') +).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + function generateSampleMessage(instance: T) { const filledObject = ( instance.constructor as typeof protobuf.Message @@ -252,26 +267,23 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() ); client.innerApiCalls.getInstance = stubSimpleCall(expectedResponse); const [response] = await client.getInstance(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance without error using callback', async () => { @@ -283,15 +295,9 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() ); @@ -314,11 +320,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance with error', async () => { @@ -330,26 +339,23 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getInstance = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.getInstance(request), expectedError); - assert( - (client.innerApiCalls.getInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getInstance with closed client', async () => { @@ -361,7 +367,8 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getInstance(request), expectedError); @@ -378,26 +385,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse() ); client.innerApiCalls.removeIamPolicy = stubSimpleCall(expectedResponse); const [response] = await client.removeIamPolicy(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeIamPolicy without error using callback', async () => { @@ -409,15 +415,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyResponse() ); @@ -440,11 +442,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeIamPolicy with error', async () => { @@ -456,26 +461,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - request.resource = ''; - const expectedHeaderRequestParams = 'resource='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; + const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.removeIamPolicy = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.removeIamPolicy(request), expectedError); - assert( - (client.innerApiCalls.removeIamPolicy as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeIamPolicy as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeIamPolicy with closed client', async () => { @@ -487,7 +491,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - request.resource = ''; + const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ + 'resource', + ]); + request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeIamPolicy(request), expectedError); @@ -504,26 +511,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse() ); client.innerApiCalls.addDnsPeering = stubSimpleCall(expectedResponse); const [response] = await client.addDnsPeering(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addDnsPeering without error using callback', async () => { @@ -535,15 +541,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringResponse() ); @@ -566,11 +568,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addDnsPeering with error', async () => { @@ -582,26 +587,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.addDnsPeering = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.addDnsPeering(request), expectedError); - assert( - (client.innerApiCalls.addDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.addDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes addDnsPeering with closed client', async () => { @@ -613,7 +617,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.addDnsPeering(request), expectedError); @@ -630,26 +637,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse() ); client.innerApiCalls.removeDnsPeering = stubSimpleCall(expectedResponse); const [response] = await client.removeDnsPeering(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDnsPeering without error using callback', async () => { @@ -661,15 +667,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringResponse() ); @@ -692,11 +694,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDnsPeering with error', async () => { @@ -708,26 +713,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.removeDnsPeering = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.removeDnsPeering(request), expectedError); - assert( - (client.innerApiCalls.removeDnsPeering as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.removeDnsPeering as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes removeDnsPeering with closed client', async () => { @@ -739,7 +743,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - request.parent = ''; + const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ + 'parent', + ]); + request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.removeDnsPeering(request), expectedError); @@ -756,15 +763,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -773,11 +776,14 @@ describe('v1beta1.DataFusionClient', () => { const [operation] = await client.createInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance without error using callback', async () => { @@ -789,15 +795,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -827,11 +829,14 @@ describe('v1beta1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance with call error', async () => { @@ -843,26 +848,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createInstance(request), expectedError); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createInstance with LRO error', async () => { @@ -874,15 +878,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createInstance = stubLongRunningCall( undefined, @@ -891,11 +891,14 @@ describe('v1beta1.DataFusionClient', () => { ); const [operation] = await client.createInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateInstanceProgress without error', async () => { @@ -950,15 +953,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -967,11 +966,14 @@ describe('v1beta1.DataFusionClient', () => { const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance without error using callback', async () => { @@ -983,15 +985,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1021,11 +1019,14 @@ describe('v1beta1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance with call error', async () => { @@ -1037,26 +1038,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteInstance(request), expectedError); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteInstance with LRO error', async () => { @@ -1068,15 +1068,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, @@ -1085,11 +1081,14 @@ describe('v1beta1.DataFusionClient', () => { ); const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteInstanceProgress without error', async () => { @@ -1144,16 +1143,13 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1162,11 +1158,14 @@ describe('v1beta1.DataFusionClient', () => { const [operation] = await client.updateInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance without error using callback', async () => { @@ -1178,16 +1177,13 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1217,11 +1213,14 @@ describe('v1beta1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance with call error', async () => { @@ -1233,27 +1232,27 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateInstance(request), expectedError); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateInstance with LRO error', async () => { @@ -1265,16 +1264,13 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); - request.instance = {}; - request.instance.name = ''; - const expectedHeaderRequestParams = 'instance.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.instance ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ + 'instance', + 'name', + ]); + request.instance.name = defaultValue1; + const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateInstance = stubLongRunningCall( undefined, @@ -1283,11 +1279,14 @@ describe('v1beta1.DataFusionClient', () => { ); const [operation] = await client.updateInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateInstanceProgress without error', async () => { @@ -1342,15 +1341,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1359,11 +1354,14 @@ describe('v1beta1.DataFusionClient', () => { const [operation] = await client.restartInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance without error using callback', async () => { @@ -1375,15 +1373,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1413,11 +1407,14 @@ describe('v1beta1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance with call error', async () => { @@ -1429,26 +1426,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.restartInstance(request), expectedError); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restartInstance with LRO error', async () => { @@ -1460,15 +1456,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restartInstance = stubLongRunningCall( undefined, @@ -1477,11 +1469,14 @@ describe('v1beta1.DataFusionClient', () => { ); const [operation] = await client.restartInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.restartInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restartInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRestartInstanceProgress without error', async () => { @@ -1536,15 +1531,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1553,11 +1544,14 @@ describe('v1beta1.DataFusionClient', () => { const [operation] = await client.upgradeInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upgradeInstance without error using callback', async () => { @@ -1569,15 +1563,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1607,11 +1597,14 @@ describe('v1beta1.DataFusionClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upgradeInstance with call error', async () => { @@ -1623,26 +1616,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.upgradeInstance(request), expectedError); - assert( - (client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes upgradeInstance with LRO error', async () => { @@ -1654,15 +1646,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.upgradeInstance = stubLongRunningCall( undefined, @@ -1671,11 +1659,14 @@ describe('v1beta1.DataFusionClient', () => { ); const [operation] = await client.upgradeInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.upgradeInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.upgradeInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpgradeInstanceProgress without error', async () => { @@ -1730,15 +1721,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Version() @@ -1754,11 +1742,14 @@ describe('v1beta1.DataFusionClient', () => { stubSimpleCall(expectedResponse); const [response] = await client.listAvailableVersions(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersions without error using callback', async () => { @@ -1770,15 +1761,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Version() @@ -1809,11 +1797,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersions with error', async () => { @@ -1825,15 +1816,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listAvailableVersions = stubSimpleCall( undefined, @@ -1843,11 +1831,14 @@ describe('v1beta1.DataFusionClient', () => { client.listAvailableVersions(request), expectedError ); - assert( - (client.innerApiCalls.listAvailableVersions as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listAvailableVersions as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listAvailableVersionsStream without error', async () => { @@ -1859,8 +1850,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Version() @@ -1900,12 +1895,15 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAvailableVersions, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1918,8 +1916,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAvailableVersions.createStream = stubPageStreamingCall(undefined, expectedError); @@ -1948,12 +1950,15 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listAvailableVersions, request) ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -1966,8 +1971,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Version() @@ -1994,12 +2003,15 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2012,8 +2024,12 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue( + 'ListAvailableVersionsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listAvailableVersions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2031,12 +2047,15 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( + assert( ( client.descriptors.page.listAvailableVersions .asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + ) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2051,15 +2070,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() @@ -2074,11 +2089,14 @@ describe('v1beta1.DataFusionClient', () => { client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); const [response] = await client.listInstances(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstances without error using callback', async () => { @@ -2090,15 +2108,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() @@ -2129,11 +2143,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstances with error', async () => { @@ -2145,26 +2162,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listInstances = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listInstances(request), expectedError); - assert( - (client.innerApiCalls.listInstances as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listInstances as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listInstancesStream without error', async () => { @@ -2176,8 +2192,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() @@ -2214,11 +2233,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listInstances, request) ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2231,8 +2251,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2258,11 +2281,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listInstances, request) ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2275,8 +2299,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Instance() @@ -2302,11 +2329,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2319,8 +2347,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listInstances.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2338,11 +2369,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listInstances.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2357,15 +2389,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Namespace() @@ -2380,11 +2408,14 @@ describe('v1beta1.DataFusionClient', () => { client.innerApiCalls.listNamespaces = stubSimpleCall(expectedResponse); const [response] = await client.listNamespaces(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNamespaces without error using callback', async () => { @@ -2396,15 +2427,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Namespace() @@ -2435,11 +2462,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNamespaces with error', async () => { @@ -2451,26 +2481,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listNamespaces = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listNamespaces(request), expectedError); - assert( - (client.innerApiCalls.listNamespaces as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listNamespaces as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listNamespacesStream without error', async () => { @@ -2482,8 +2511,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Namespace() @@ -2521,11 +2553,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNamespaces, request) ); - assert.strictEqual( - ( - client.descriptors.page.listNamespaces.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2538,8 +2571,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNamespaces.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2566,11 +2602,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listNamespaces, request) ); - assert.strictEqual( - ( - client.descriptors.page.listNamespaces.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listNamespaces.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2583,8 +2620,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.Namespace() @@ -2610,11 +2650,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listNamespaces.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2627,8 +2668,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listNamespaces.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2646,11 +2690,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listNamespaces.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listNamespaces.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); @@ -2665,15 +2710,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DnsPeering() @@ -2688,11 +2729,14 @@ describe('v1beta1.DataFusionClient', () => { client.innerApiCalls.listDnsPeerings = stubSimpleCall(expectedResponse); const [response] = await client.listDnsPeerings(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDnsPeerings without error using callback', async () => { @@ -2704,15 +2748,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DnsPeering() @@ -2743,11 +2783,14 @@ describe('v1beta1.DataFusionClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDnsPeerings with error', async () => { @@ -2759,26 +2802,25 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listDnsPeerings = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listDnsPeerings(request), expectedError); - assert( - (client.innerApiCalls.listDnsPeerings as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listDnsPeerings as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listDnsPeeringsStream without error', async () => { @@ -2790,8 +2832,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DnsPeering() @@ -2829,11 +2874,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listDnsPeerings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listDnsPeerings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2846,8 +2892,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDnsPeerings.createStream = stubPageStreamingCall(undefined, expectedError); @@ -2874,11 +2923,12 @@ describe('v1beta1.DataFusionClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listDnsPeerings, request) ); - assert.strictEqual( - ( - client.descriptors.page.listDnsPeerings.createStream as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listDnsPeerings.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2891,8 +2941,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DnsPeering() @@ -2919,11 +2972,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2936,8 +2990,11 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listDnsPeerings.asyncIterate = stubAsyncIterationCall(undefined, expectedError); @@ -2955,11 +3012,12 @@ describe('v1beta1.DataFusionClient', () => { ).getCall(0).args[1], request ); - assert.strictEqual( - ( - client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub - ).getCall(0).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listDnsPeerings.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From 84f3050e263c9ea5a125d0ded93c35a34f6cf873 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 14:35:52 -0700 Subject: [PATCH 42/47] test: use fully qualified request type name in tests (#70) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: use fully qualified request type name in tests PiperOrigin-RevId: 475685359 Source-Link: https://github.com/googleapis/googleapis/commit/7a129736313ceb1f277c3b7f7e16d2e04cc901dd Source-Link: https://github.com/googleapis/googleapis-gen/commit/370c729e2ba062a167449c27882ba5f379c5c34d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzcwYzcyOWUyYmEwNjJhMTY3NDQ5YzI3ODgyYmE1ZjM3OWM1YzM0ZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../test/gapic_data_fusion_v1.ts | 199 +++++---- .../test/gapic_data_fusion_v1beta1.ts | 409 ++++++++++-------- 2 files changed, 350 insertions(+), 258 deletions(-) diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts index 068d1b7fe5a..18f75a18234 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1.ts @@ -267,7 +267,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -295,7 +298,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -339,7 +345,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -367,7 +376,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -385,9 +397,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -417,9 +430,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -470,9 +484,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -500,9 +515,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -575,9 +591,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -607,9 +624,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -660,9 +678,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -690,9 +709,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -766,10 +786,10 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -800,10 +820,10 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -855,10 +875,10 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -887,10 +907,10 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -963,9 +983,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -995,9 +1016,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1048,9 +1070,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1078,9 +1101,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1154,7 +1178,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1188,7 +1212,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1237,7 +1261,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1271,7 +1295,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1331,7 +1355,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1386,7 +1410,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1433,7 +1457,7 @@ describe('v1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1478,9 +1502,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1510,9 +1535,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1558,9 +1584,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1588,9 +1615,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1641,9 +1669,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1689,9 +1718,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1731,9 +1761,10 @@ describe('v1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts index 739d1096055..31ba33c17a4 100644 --- a/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts +++ b/packages/google-cloud-datafusion/test/gapic_data_fusion_v1beta1.ts @@ -267,7 +267,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -295,7 +298,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -339,7 +345,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -367,7 +376,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -385,9 +397,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -415,9 +428,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -461,9 +475,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedHeaderRequestParams = `resource=${defaultValue1}`; const expectedError = new Error('expected'); @@ -491,9 +506,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveIamPolicyRequest', [ - 'resource', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveIamPolicyRequest', + ['resource'] + ); request.resource = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -511,9 +527,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -541,9 +558,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -587,9 +605,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -617,9 +636,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('AddDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.AddDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -637,9 +657,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -667,9 +688,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -713,9 +735,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -743,9 +766,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest() ); - const defaultValue1 = getTypeDefaultValue('RemoveDnsPeeringRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RemoveDnsPeeringRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -763,9 +787,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -795,9 +820,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -848,9 +874,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -878,9 +905,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -953,9 +981,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -985,9 +1014,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1038,9 +1068,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1068,9 +1099,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1144,10 +1176,10 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1178,10 +1210,10 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1233,10 +1265,10 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1265,10 +1297,10 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1341,9 +1373,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1373,9 +1406,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1426,9 +1460,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1456,9 +1491,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.RestartInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestartInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.RestartInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1531,9 +1567,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1563,9 +1600,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1616,9 +1654,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1646,9 +1685,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('UpgradeInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.UpgradeInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1722,7 +1762,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1762,7 +1802,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1817,7 +1857,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1851,7 +1891,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1917,7 +1957,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -1972,7 +2012,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2025,7 +2065,7 @@ describe('v1beta1.DataFusionClient', () => { new protos.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest() ); const defaultValue1 = getTypeDefaultValue( - 'ListAvailableVersionsRequest', + '.google.cloud.datafusion.v1beta1.ListAvailableVersionsRequest', ['parent'] ); request.parent = defaultValue1; @@ -2070,9 +2110,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2108,9 +2149,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2162,9 +2204,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2192,9 +2235,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2251,9 +2295,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2299,9 +2344,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2347,9 +2393,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2389,9 +2436,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2427,9 +2475,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2481,9 +2530,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2511,9 +2561,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2571,9 +2622,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2620,9 +2672,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2668,9 +2721,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListNamespacesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListNamespacesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListNamespacesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2710,9 +2764,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2748,9 +2803,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2802,9 +2858,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2832,9 +2889,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2892,9 +2950,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2941,9 +3000,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2990,9 +3050,10 @@ describe('v1beta1.DataFusionClient', () => { const request = generateSampleMessage( new protos.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListDnsPeeringsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.datafusion.v1beta1.ListDnsPeeringsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From 69c794a35990f1183b486a5a721a836bb7a528a2 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:40:04 -0700 Subject: [PATCH 43/47] fix(deps): use google-gax v3.5.2 (#74) --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 6c34445e095..d74f1ca02ee 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -39,7 +39,7 @@ "prelint": "cd samples; npm link ../; npm i" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From 108adf6ae4f464a7cfe85c40def0b1ec9d4a0d78 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:28:17 +0100 Subject: [PATCH 44/47] chore(deps): update dependency @types/node to v18 (#72) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@types/node](https://togithub.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node) ([source](https://togithub.com/DefinitelyTyped/DefinitelyTyped)) | [`^16.0.0` -> `^18.0.0`](https://renovatebot.com/diffs/npm/@types%2fnode/16.18.3/18.11.9) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/compatibility-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fnode/18.11.9/confidence-slim/16.18.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index d74f1ca02ee..56f90b053f2 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -43,7 +43,7 @@ }, "devDependencies": { "@types/mocha": "^9.0.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", From befa2ab1600466fda4bf71d04fc4362c184d13b0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 10 Nov 2022 10:18:32 +0000 Subject: [PATCH 45/47] fix: regenerated protos JS and TS definitions (#77) samples: pull in latest typeless bot, clean up some comments Source-Link: https://togithub.com/googleapis/synthtool/commit/0a68e568b6911b60bb6fd452eba4848b176031d8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:5b05f26103855c3a15433141389c478d1d3fe088fb5d4e3217c4793f6b3f245e --- .../protos/protos.d.ts | 2 +- .../google-cloud-datafusion/protos/protos.js | 192 +++++++++++++++--- 2 files changed, 168 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-datafusion/protos/protos.d.ts b/packages/google-cloud-datafusion/protos/protos.d.ts index 5df538a36dd..07a16338657 100644 --- a/packages/google-cloud-datafusion/protos/protos.d.ts +++ b/packages/google-cloud-datafusion/protos/protos.d.ts @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import Long = require("long"); import type {protobuf as $protobuf} from "google-gax"; +import Long = require("long"); /** Namespace google. */ export namespace google { diff --git a/packages/google-cloud-datafusion/protos/protos.js b/packages/google-cloud-datafusion/protos/protos.js index 89a6b5520de..559ded005b5 100644 --- a/packages/google-cloud-datafusion/protos/protos.js +++ b/packages/google-cloud-datafusion/protos/protos.js @@ -788,6 +788,12 @@ message.availableFeatures[i] = String(object.availableFeatures[i]); } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -834,7 +840,7 @@ object.availableFeatures[j] = message.availableFeatures[j]; } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Version.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Version.Type[message.type] === undefined ? message.type : $root.google.cloud.datafusion.v1.Version.Type[message.type] : message.type; return object; }; @@ -1065,6 +1071,12 @@ return object; var message = new $root.google.cloud.datafusion.v1.Accelerator(); switch (object.acceleratorType) { + default: + if (typeof object.acceleratorType === "number") { + message.acceleratorType = object.acceleratorType; + break; + } + break; case "ACCELERATOR_TYPE_UNSPECIFIED": case 0: message.acceleratorType = 0; @@ -1083,6 +1095,12 @@ break; } switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -1121,9 +1139,9 @@ object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; } if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; + object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.AcceleratorType[message.acceleratorType] === undefined ? message.acceleratorType : $root.google.cloud.datafusion.v1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.datafusion.v1.Accelerator.State[message.state] === undefined ? message.state : $root.google.cloud.datafusion.v1.Accelerator.State[message.state] : message.state; return object; }; @@ -2157,6 +2175,12 @@ if (object.description != null) message.description = String(object.description); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -2210,6 +2234,12 @@ 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; @@ -2311,6 +2341,10 @@ for (var i = 0; i < object.disabledReason.length; ++i) switch (object.disabledReason[i]) { default: + if (typeof object.disabledReason[i] === "number") { + message.disabledReason[i] = object.disabledReason[i]; + break; + } case "DISABLED_REASON_UNSPECIFIED": case 0: message.disabledReason[i] = 0; @@ -2376,7 +2410,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.Type[message.type] === undefined ? message.type : $root.google.cloud.datafusion.v1.Instance.Type[message.type] : message.type; if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) object.enableStackdriverLogging = message.enableStackdriverLogging; if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) @@ -2401,7 +2435,7 @@ 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.datafusion.v1.Instance.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.datafusion.v1.Instance.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) @@ -2441,7 +2475,7 @@ if (message.disabledReason && message.disabledReason.length) { object.disabledReason = []; for (var j = 0; j < message.disabledReason.length; ++j) - object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; + object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1.Instance.DisabledReason[message.disabledReason[j]] === undefined ? message.disabledReason[j] : $root.google.cloud.datafusion.v1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; } return object; }; @@ -6088,6 +6122,12 @@ message.availableFeatures[i] = String(object.availableFeatures[i]); } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -6134,7 +6174,7 @@ object.availableFeatures[j] = message.availableFeatures[j]; } if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Version.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Version.Type[message.type] === undefined ? message.type : $root.google.cloud.datafusion.v1beta1.Version.Type[message.type] : message.type; return object; }; @@ -6339,6 +6379,12 @@ return object; var message = new $root.google.cloud.datafusion.v1beta1.Accelerator(); switch (object.acceleratorType) { + default: + if (typeof object.acceleratorType === "number") { + message.acceleratorType = object.acceleratorType; + break; + } + break; case "ACCELERATOR_TYPE_UNSPECIFIED": case 0: message.acceleratorType = 0; @@ -6371,7 +6417,7 @@ if (options.defaults) object.acceleratorType = options.enums === String ? "ACCELERATOR_TYPE_UNSPECIFIED" : 0; if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) - object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; + object.acceleratorType = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType[message.acceleratorType] === undefined ? message.acceleratorType : $root.google.cloud.datafusion.v1beta1.Accelerator.AcceleratorType[message.acceleratorType] : message.acceleratorType; return object; }; @@ -7385,6 +7431,12 @@ if (object.description != null) message.description = String(object.description); switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_UNSPECIFIED": case 0: message.type = 0; @@ -7438,6 +7490,12 @@ 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; @@ -7539,6 +7597,10 @@ for (var i = 0; i < object.disabledReason.length; ++i) switch (object.disabledReason[i]) { default: + if (typeof object.disabledReason[i] === "number") { + message.disabledReason[i] = object.disabledReason[i]; + break; + } case "DISABLED_REASON_UNSPECIFIED": case 0: message.disabledReason[i] = 0; @@ -7604,7 +7666,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.Type[message.type] : message.type; + object.type = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.Type[message.type] === undefined ? message.type : $root.google.cloud.datafusion.v1beta1.Instance.Type[message.type] : message.type; if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) object.enableStackdriverLogging = message.enableStackdriverLogging; if (message.enableStackdriverMonitoring != null && message.hasOwnProperty("enableStackdriverMonitoring")) @@ -7629,7 +7691,7 @@ 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.datafusion.v1beta1.Instance.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.datafusion.v1beta1.Instance.State[message.state] : message.state; if (message.stateMessage != null && message.hasOwnProperty("stateMessage")) object.stateMessage = message.stateMessage; if (message.serviceEndpoint != null && message.hasOwnProperty("serviceEndpoint")) @@ -7669,7 +7731,7 @@ if (message.disabledReason && message.disabledReason.length) { object.disabledReason = []; for (var j = 0; j < message.disabledReason.length; ++j) - object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; + object.disabledReason[j] = options.enums === String ? $root.google.cloud.datafusion.v1beta1.Instance.DisabledReason[message.disabledReason[j]] === undefined ? message.disabledReason[j] : $root.google.cloud.datafusion.v1beta1.Instance.DisabledReason[message.disabledReason[j]] : message.disabledReason[j]; } return object; }; @@ -11122,6 +11184,12 @@ if (object.pageToken != null) message.pageToken = String(object.pageToken); switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; case "NAMESPACE_VIEW_UNSPECIFIED": case 0: message.view = 0; @@ -11164,7 +11232,7 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.datafusion.v1beta1.NamespaceView[message.view] : message.view; + object.view = options.enums === String ? $root.google.cloud.datafusion.v1beta1.NamespaceView[message.view] === undefined ? message.view : $root.google.cloud.datafusion.v1beta1.NamespaceView[message.view] : message.view; return object; }; @@ -14844,6 +14912,12 @@ 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; @@ -14868,6 +14942,10 @@ 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; @@ -14915,7 +14993,7 @@ 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] : message.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")) @@ -14923,7 +15001,7 @@ 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]] : message.style[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; }; @@ -17734,6 +17812,12 @@ 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; @@ -17748,6 +17832,12 @@ break; } switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; case "TYPE_DOUBLE": case 1: message.type = 1; @@ -17874,9 +17964,9 @@ 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] : message.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] : message.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")) @@ -20223,6 +20313,12 @@ 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; @@ -20331,7 +20427,7 @@ 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] : message.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")) @@ -21133,6 +21229,12 @@ 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; @@ -21149,6 +21251,12 @@ 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; @@ -21187,6 +21295,10 @@ 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; @@ -21257,7 +21369,7 @@ object[".google.api.resourceReference"] = null; } if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.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")) @@ -21265,7 +21377,7 @@ 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] : message.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")) @@ -21278,7 +21390,7 @@ 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]] : message[".google.api.fieldBehavior"][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); @@ -22655,6 +22767,12 @@ 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; @@ -22724,7 +22842,7 @@ 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] : message.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) @@ -24479,6 +24597,12 @@ 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; @@ -24528,7 +24652,7 @@ 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] : message.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; }; @@ -29165,6 +29289,12 @@ return object; var message = new $root.google.iam.v1.AuditLogConfig(); switch (object.logType) { + default: + if (typeof object.logType === "number") { + message.logType = object.logType; + break; + } + break; case "LOG_TYPE_UNSPECIFIED": case 0: message.logType = 0; @@ -29210,7 +29340,7 @@ if (options.defaults) object.logType = options.enums === String ? "LOG_TYPE_UNSPECIFIED" : 0; if (message.logType != null && message.hasOwnProperty("logType")) - object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; + object.logType = options.enums === String ? $root.google.iam.v1.AuditLogConfig.LogType[message.logType] === undefined ? message.logType : $root.google.iam.v1.AuditLogConfig.LogType[message.logType] : message.logType; if (message.exemptedMembers && message.exemptedMembers.length) { object.exemptedMembers = []; for (var j = 0; j < message.exemptedMembers.length; ++j) @@ -29747,6 +29877,12 @@ return object; var message = new $root.google.iam.v1.BindingDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -29792,7 +29928,7 @@ object.condition = null; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.BindingDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.BindingDelta.Action[message.action] : message.action; if (message.role != null && message.hasOwnProperty("role")) object.role = message.role; if (message.member != null && message.hasOwnProperty("member")) @@ -30057,6 +30193,12 @@ return object; var message = new $root.google.iam.v1.AuditConfigDelta(); switch (object.action) { + default: + if (typeof object.action === "number") { + message.action = object.action; + break; + } + break; case "ACTION_UNSPECIFIED": case 0: message.action = 0; @@ -30099,7 +30241,7 @@ object.logType = ""; } if (message.action != null && message.hasOwnProperty("action")) - object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; + object.action = options.enums === String ? $root.google.iam.v1.AuditConfigDelta.Action[message.action] === undefined ? message.action : $root.google.iam.v1.AuditConfigDelta.Action[message.action] : message.action; if (message.service != null && message.hasOwnProperty("service")) object.service = message.service; if (message.exemptedMember != null && message.hasOwnProperty("exemptedMember")) From 001141d509ab277f088f001a435a193912c6a3f4 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 13:20:17 +0100 Subject: [PATCH 46/47] chore(deps): update dependency jsdoc to v4 (#76) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [jsdoc](https://togithub.com/jsdoc/jsdoc) | [`^3.6.6` -> `^4.0.0`](https://renovatebot.com/diffs/npm/jsdoc/3.6.11/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/compatibility-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/jsdoc/4.0.0/confidence-slim/3.6.11)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
jsdoc/jsdoc ### [`v4.0.0`](https://togithub.com/jsdoc/jsdoc/blob/HEAD/CHANGES.md#​400-November-2022) [Compare Source](https://togithub.com/jsdoc/jsdoc/compare/3.6.11...084218523a7d69fec14a852ce680f374f526af28) - JSDoc releases now use [semantic versioning](https://semver.org/). If JSDoc makes backwards-incompatible changes in the future, the major version will be incremented. - JSDoc no longer uses the [`taffydb`](https://taffydb.com/) package. If your JSDoc template or plugin uses the `taffydb` package, see the [instructions for replacing `taffydb` with `@jsdoc/salty`](https://togithub.com/jsdoc/jsdoc/tree/main/packages/jsdoc-salty#use-salty-in-a-jsdoc-template). - JSDoc now supports Node.js 12.0.0 and later.
--- ### Configuration 📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-data-fusion). --- packages/google-cloud-datafusion/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 56f90b053f2..73f1e557c12 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -47,7 +47,7 @@ "@types/sinon": "^10.0.0", "c8": "^7.7.2", "gts": "^3.1.0", - "jsdoc": "^3.6.6", + "jsdoc": "^4.0.0", "jsdoc-fresh": "^2.0.0", "jsdoc-region-tag": "^2.0.0", "linkinator": "^4.0.0", From 2099167ec759a4b07ec741ece3017c1487f4b1ab Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 02:44:18 +0000 Subject: [PATCH 47/47] chore(main): release 2.1.2 (#68) :robot: I have created a release *beep* *boop* --- ## [2.1.2](https://togithub.com/googleapis/nodejs-data-fusion/compare/v2.1.1...v2.1.2) (2022-11-10) ### Bug Fixes * **deps:** Use google-gax v3.5.2 ([#74](https://togithub.com/googleapis/nodejs-data-fusion/issues/74)) ([764335c](https://togithub.com/googleapis/nodejs-data-fusion/commit/764335ce183a3f2557cc6555c87ebe6a2b4f2251)) * Preserve default values in x-goog-request-params header ([#67](https://togithub.com/googleapis/nodejs-data-fusion/issues/67)) ([2a4981c](https://togithub.com/googleapis/nodejs-data-fusion/commit/2a4981c4677c451783b309669abd93138fcde971)) * Regenerated protos JS and TS definitions ([#77](https://togithub.com/googleapis/nodejs-data-fusion/issues/77)) ([8e36541](https://togithub.com/googleapis/nodejs-data-fusion/commit/8e365416725258222a210c3e2b5731b9f1fab48f)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please). --- packages/google-cloud-datafusion/CHANGELOG.md | 9 +++++++++ packages/google-cloud-datafusion/package.json | 2 +- .../v1/snippet_metadata.google.cloud.datafusion.v1.json | 2 +- ...snippet_metadata.google.cloud.datafusion.v1beta1.json | 2 +- packages/google-cloud-datafusion/samples/package.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-datafusion/CHANGELOG.md b/packages/google-cloud-datafusion/CHANGELOG.md index cce958c5615..488390fb890 100644 --- a/packages/google-cloud-datafusion/CHANGELOG.md +++ b/packages/google-cloud-datafusion/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## [2.1.2](https://github.com/googleapis/nodejs-data-fusion/compare/v2.1.1...v2.1.2) (2022-11-10) + + +### Bug Fixes + +* **deps:** Use google-gax v3.5.2 ([#74](https://github.com/googleapis/nodejs-data-fusion/issues/74)) ([764335c](https://github.com/googleapis/nodejs-data-fusion/commit/764335ce183a3f2557cc6555c87ebe6a2b4f2251)) +* Preserve default values in x-goog-request-params header ([#67](https://github.com/googleapis/nodejs-data-fusion/issues/67)) ([2a4981c](https://github.com/googleapis/nodejs-data-fusion/commit/2a4981c4677c451783b309669abd93138fcde971)) +* Regenerated protos JS and TS definitions ([#77](https://github.com/googleapis/nodejs-data-fusion/issues/77)) ([8e36541](https://github.com/googleapis/nodejs-data-fusion/commit/8e365416725258222a210c3e2b5731b9f1fab48f)) + ## [2.1.1](https://github.com/googleapis/nodejs-data-fusion/compare/v2.1.0...v2.1.1) (2022-09-01) diff --git a/packages/google-cloud-datafusion/package.json b/packages/google-cloud-datafusion/package.json index 73f1e557c12..abaf61da7c7 100644 --- a/packages/google-cloud-datafusion/package.json +++ b/packages/google-cloud-datafusion/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/data-fusion", - "version": "2.1.1", + "version": "2.1.2", "description": "datafusion client for Node.js", "repository": "googleapis/nodejs-data-fusion", "license": "Apache-2.0", diff --git a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json index 6bfafa0aada..1b9b2c501d1 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1/snippet_metadata.google.cloud.datafusion.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.1.1", + "version": "2.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json index 6a8159f570d..b20ece2f58a 100644 --- a/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json +++ b/packages/google-cloud-datafusion/samples/generated/v1beta1/snippet_metadata.google.cloud.datafusion.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-datafusion", - "version": "2.1.1", + "version": "2.1.2", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-datafusion/samples/package.json b/packages/google-cloud-datafusion/samples/package.json index db77e8773a4..289f09eda24 100644 --- a/packages/google-cloud-datafusion/samples/package.json +++ b/packages/google-cloud-datafusion/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/data-fusion": "^2.1.1" + "@google-cloud/data-fusion": "^2.1.2" }, "devDependencies": { "c8": "^7.1.0",