From b46e2db7366031d8ae63bf651c0dc225c7c23962 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Fri, 16 Jul 2021 14:10:34 -0700 Subject: [PATCH 01/59] feat: initial stub of library --- .../google-cloud-filestore/CODE_OF_CONDUCT.md | 94 ++++++++ .../google-cloud-filestore/CONTRIBUTING.md | 76 +++++++ packages/google-cloud-filestore/LICENSE | 202 ++++++++++++++++++ packages/google-cloud-filestore/README.md | 120 +++++++++++ 4 files changed, 492 insertions(+) create mode 100644 packages/google-cloud-filestore/CODE_OF_CONDUCT.md create mode 100644 packages/google-cloud-filestore/CONTRIBUTING.md create mode 100644 packages/google-cloud-filestore/LICENSE create mode 100644 packages/google-cloud-filestore/README.md diff --git a/packages/google-cloud-filestore/CODE_OF_CONDUCT.md b/packages/google-cloud-filestore/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/packages/google-cloud-filestore/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-filestore/CONTRIBUTING.md b/packages/google-cloud-filestore/CONTRIBUTING.md new file mode 100644 index 00000000000..4d20b52f046 --- /dev/null +++ b/packages/google-cloud-filestore/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 Filestore 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=file.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started \ No newline at end of file diff --git a/packages/google-cloud-filestore/LICENSE b/packages/google-cloud-filestore/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/packages/google-cloud-filestore/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-filestore/README.md b/packages/google-cloud-filestore/README.md new file mode 100644 index 00000000000..ded09ad5fda --- /dev/null +++ b/packages/google-cloud-filestore/README.md @@ -0,0 +1,120 @@ +[//]: # "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 + +# [Filestore: Node.js Client](https://github.com/googleapis/nodejs-filestore) + +[![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/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) + + + + +file client for Node.js + + +A comprehensive list of changes in each version may be found in +[the CHANGELOG](https://github.com/googleapis/nodejs-filestore/blob/master/CHANGELOG.md). + +* [Filestore Node.js Client API Reference][client-docs] +* [Filestore Documentation][product-docs] +* [github.com/googleapis/nodejs-filestore](https://github.com/googleapis/nodejs-filestore) + +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 Filestore 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/filestore +``` + + + + + +The [Filestore 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/). + + + + + + +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-filestore/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 template in this +[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). + +## License + +Apache Version 2.0 + +See [LICENSE](https://github.com/googleapis/nodejs-filestore/blob/master/LICENSE) + +[client-docs]: https://googleapis.dev/nodejs/filestore/latest +[product-docs]: https://cloud.google.com/filestore/ +[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=file.googleapis.com +[auth]: https://cloud.google.com/docs/authentication/getting-started From b31c7e41250d9c3156c221546f105d43f9fd4349 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 21 Jul 2021 15:20:29 -0400 Subject: [PATCH 02/59] feat!: initial generation of filestore API (#2) --- packages/google-cloud-filestore/.eslintignore | 6 + .../google-cloud-filestore/.eslintrc.json | 3 + .../google-cloud-filestore/.gitattributes | 4 + .../.github/.OwlBot.yaml | 22 + packages/google-cloud-filestore/.gitignore | 14 + packages/google-cloud-filestore/.jsdoc.js | 55 + packages/google-cloud-filestore/.mocharc.js | 29 + packages/google-cloud-filestore/.nycrc | 24 + .../google-cloud-filestore/.prettierignore | 6 + .../google-cloud-filestore/.prettierrc.js | 17 + .../.repo-metadata.json | 14 + packages/google-cloud-filestore/README.md | 44 +- .../linkinator.config.json | 10 + packages/google-cloud-filestore/package.json | 66 + .../cloud/common/operation_metadata.proto | 53 + .../v1/cloud_filestore_service.proto | 719 + .../v1beta1/cloud_filestore_service.proto | 732 + .../google-cloud-filestore/protos/protos.d.ts | 10688 ++++++ .../google-cloud-filestore/protos/protos.js | 27055 ++++++++++++++++ .../google-cloud-filestore/protos/protos.json | 3221 ++ .../google-cloud-filestore/samples/README.md | 50 + .../samples/package.json | 22 + .../samples/quickstart.js | 43 + .../samples/test/quickstart.js | 34 + packages/google-cloud-filestore/src/index.ts | 28 + .../src/v1/cloud_filestore_manager_client.ts | 2244 ++ ...cloud_filestore_manager_client_config.json | 93 + .../cloud_filestore_manager_proto_list.json | 4 + .../src/v1/gapic_metadata.json | 141 + .../google-cloud-filestore/src/v1/index.ts | 19 + .../v1beta1/cloud_filestore_manager_client.ts | 2324 ++ ...cloud_filestore_manager_client_config.json | 93 + .../cloud_filestore_manager_proto_list.json | 4 + .../src/v1beta1/gapic_metadata.json | 141 + .../src/v1beta1/index.ts | 19 + .../system-test/fixtures/sample/src/index.js | 27 + .../system-test/fixtures/sample/src/index.ts | 34 + .../system-test/install.ts | 51 + .../test/gapic_cloud_filestore_manager_v1.ts | 2619 ++ .../gapic_cloud_filestore_manager_v1beta1.ts | 2734 ++ packages/google-cloud-filestore/tsconfig.json | 19 + .../google-cloud-filestore/webpack.config.js | 64 + 42 files changed, 53586 insertions(+), 3 deletions(-) create mode 100644 packages/google-cloud-filestore/.eslintignore create mode 100644 packages/google-cloud-filestore/.eslintrc.json create mode 100644 packages/google-cloud-filestore/.gitattributes create mode 100644 packages/google-cloud-filestore/.github/.OwlBot.yaml create mode 100644 packages/google-cloud-filestore/.gitignore create mode 100644 packages/google-cloud-filestore/.jsdoc.js create mode 100644 packages/google-cloud-filestore/.mocharc.js create mode 100644 packages/google-cloud-filestore/.nycrc create mode 100644 packages/google-cloud-filestore/.prettierignore create mode 100644 packages/google-cloud-filestore/.prettierrc.js create mode 100644 packages/google-cloud-filestore/.repo-metadata.json create mode 100644 packages/google-cloud-filestore/linkinator.config.json create mode 100644 packages/google-cloud-filestore/package.json create mode 100644 packages/google-cloud-filestore/protos/google/cloud/common/operation_metadata.proto create mode 100644 packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto create mode 100644 packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto create mode 100644 packages/google-cloud-filestore/protos/protos.d.ts create mode 100644 packages/google-cloud-filestore/protos/protos.js create mode 100644 packages/google-cloud-filestore/protos/protos.json create mode 100644 packages/google-cloud-filestore/samples/README.md create mode 100644 packages/google-cloud-filestore/samples/package.json create mode 100644 packages/google-cloud-filestore/samples/quickstart.js create mode 100644 packages/google-cloud-filestore/samples/test/quickstart.js create mode 100644 packages/google-cloud-filestore/src/index.ts create mode 100644 packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts create mode 100644 packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client_config.json create mode 100644 packages/google-cloud-filestore/src/v1/cloud_filestore_manager_proto_list.json create mode 100644 packages/google-cloud-filestore/src/v1/gapic_metadata.json create mode 100644 packages/google-cloud-filestore/src/v1/index.ts create mode 100644 packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts create mode 100644 packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json create mode 100644 packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_proto_list.json create mode 100644 packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json create mode 100644 packages/google-cloud-filestore/src/v1beta1/index.ts create mode 100644 packages/google-cloud-filestore/system-test/fixtures/sample/src/index.js create mode 100644 packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts create mode 100644 packages/google-cloud-filestore/system-test/install.ts create mode 100644 packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts create mode 100644 packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts create mode 100644 packages/google-cloud-filestore/tsconfig.json create mode 100644 packages/google-cloud-filestore/webpack.config.js diff --git a/packages/google-cloud-filestore/.eslintignore b/packages/google-cloud-filestore/.eslintignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-filestore/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-filestore/.eslintrc.json b/packages/google-cloud-filestore/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/packages/google-cloud-filestore/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/packages/google-cloud-filestore/.gitattributes b/packages/google-cloud-filestore/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/packages/google-cloud-filestore/.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-filestore/.github/.OwlBot.yaml b/packages/google-cloud-filestore/.github/.OwlBot.yaml new file mode 100644 index 00000000000..a147b06c66b --- /dev/null +++ b/packages/google-cloud-filestore/.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/filestore/(.*)/.*-nodejs/(.*) + dest: /owl-bot-staging/$1/$2 diff --git a/packages/google-cloud-filestore/.gitignore b/packages/google-cloud-filestore/.gitignore new file mode 100644 index 00000000000..5d32b23782f --- /dev/null +++ b/packages/google-cloud-filestore/.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-filestore/.jsdoc.js b/packages/google-cloud-filestore/.jsdoc.js new file mode 100644 index 00000000000..46ffdfdbe5f --- /dev/null +++ b/packages/google-cloud-filestore/.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/filestore', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/packages/google-cloud-filestore/.mocharc.js b/packages/google-cloud-filestore/.mocharc.js new file mode 100644 index 00000000000..0b600509bed --- /dev/null +++ b/packages/google-cloud-filestore/.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-filestore/.nycrc b/packages/google-cloud-filestore/.nycrc new file mode 100644 index 00000000000..b18d5472b62 --- /dev/null +++ b/packages/google-cloud-filestore/.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-filestore/.prettierignore b/packages/google-cloud-filestore/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/packages/google-cloud-filestore/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/packages/google-cloud-filestore/.prettierrc.js b/packages/google-cloud-filestore/.prettierrc.js new file mode 100644 index 00000000000..d1b95106f4c --- /dev/null +++ b/packages/google-cloud-filestore/.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-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json new file mode 100644 index 00000000000..8df22e00bef --- /dev/null +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -0,0 +1,14 @@ +{ + "name": "filestore", + "name_pretty": "Filestore", + "product_documentation": "https://cloud.google.com/filestore/", + "client_documentation": "https://googleapis.dev/nodejs/filestore/latest", + "issue_tracker": "https://github.com/googleapis/nodejs-filestore/issues", + "release_level": "ga", + "language": "nodejs", + "repo": "googleapis/nodejs-filestore", + "distribution_name": "@google-cloud/filestore", + "api_id": "file.googleapis.com", + "default_version": "v1", + "requires_billing": true +} \ No newline at end of file diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index ded09ad5fda..74b69a6ff2d 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -4,7 +4,7 @@ # [Filestore: Node.js Client](https://github.com/googleapis/nodejs-filestore) -[![release level](https://img.shields.io/badge/release%20level-beta-yellow.svg?style=flat)](https://cloud.google.com/terms/launch-stages) +[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) @@ -32,8 +32,8 @@ Google APIs Client Libraries, in [Client Libraries Explained][explained]. * [Quickstart](#quickstart) * [Before you begin](#before-you-begin) * [Installing the client library](#installing-the-client-library) - - + * [Using the client library](#using-the-client-library) +* [Samples](#samples) * [Versioning](#versioning) * [Contributing](#contributing) * [License](#license) @@ -55,6 +55,38 @@ npm install @google-cloud/filestore ``` +### Using the client library + +```javascript +/** + * TODO(developer): Uncomment these variables before running the sample. + */ +// const projectId = 'my-project'; +// const location = 'us-central1-a'; + +// Imports the Google Cloud Some API library +const {CloudFilestoreManagerClient} = require('@google-cloud/filestore'); +const client = new CloudFilestoreManagerClient(); +async function listInstances() { + for await (const instance of client.listInstancesAsync({ + parent: `projects/${projectId}/locations/${location}`, + })) { + console.info(instance); + } +} +listInstances(); + +``` + + + +## Samples + +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-filestore/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. + +| Sample | Source Code | Try it | +| --------------------------- | --------------------------------- | ------ | +| Quickstart | [source code](https://github.com/googleapis/nodejs-filestore/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -87,6 +119,12 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). +This library is considered to be **General Availability (GA)**. This means it +is 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 **GA** libraries +are addressed with the highest priority. + diff --git a/packages/google-cloud-filestore/linkinator.config.json b/packages/google-cloud-filestore/linkinator.config.json new file mode 100644 index 00000000000..29a223b6db6 --- /dev/null +++ b/packages/google-cloud-filestore/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-filestore/package.json b/packages/google-cloud-filestore/package.json new file mode 100644 index 00000000000..ac1a18ff312 --- /dev/null +++ b/packages/google-cloud-filestore/package.json @@ -0,0 +1,66 @@ +{ + "name": "@google-cloud/filestore", + "version": "0.1.0", + "description": "file client for Node.js", + "repository": "googleapis/nodejs-filestore", + "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 file", + "file", + "file 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", + "prelint": "cd samples; npm link ../; npm install", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.19.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-filestore/protos/google/cloud/common/operation_metadata.proto b/packages/google-cloud-filestore/protos/google/cloud/common/operation_metadata.proto new file mode 100644 index 00000000000..24300e36f8a --- /dev/null +++ b/packages/google-cloud-filestore/protos/google/cloud/common/operation_metadata.proto @@ -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. + +syntax = "proto3"; + +package google.cloud.common; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "google.golang.org/genproto/googleapis/cloud/common;common"; +option java_multiple_files = true; +option java_package = "com.google.cloud.common"; + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_detail = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have [Operation.error][] value with a [google.rpc.Status.code][] of 1, + // corresponding to `Code.CANCELLED`. + bool cancel_requested = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto new file mode 100644 index 00000000000..7959abf009e --- /dev/null +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto @@ -0,0 +1,719 @@ +// 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.filestore.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"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Filestore.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1;filestore"; +option java_multiple_files = true; +option java_outer_classname = "CloudFilestoreServiceProto"; +option java_package = "com.google.cloud.filestore.v1"; +option php_namespace = "Google\\Cloud\\Filestore\\V1"; + +// Configures and manages Cloud Filestore resources. +// +// Cloud Filestore Manager v1. +// +// The `file.googleapis.com` service implements the Cloud Filestore API and +// defines the following resource model for managing instances: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of instances and backups, named: +// `/instances/*` and `/backups/*` respectively. +// * As such, Cloud Filestore instances are resources of the form: +// `/projects/{project_number}/locations/{location_id}/instances/{instance_id}` +// and backups are resources of the form: +// `/projects/{project_number}/locations/{location_id}/backup/{backup_id}` +// +// Note that location_id must be a GCP `zone` for instances and but to a GCP +// `region` for backups; for example: +// * `projects/12345/locations/us-central1-c/instances/my-filestore` +// * `projects/12345/locations/us-central1/backups/my-backup` +service CloudFilestoreManager { + option (google.api.default_host) = "file.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all instances in a project for either a specified location + // or for all locations. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance. + // When creating from a backup, the capacity of the new instance needs to be + // equal to or larger than the capacity of the backup (and also equal to or + // larger than the minimum capacity of the tier). + 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: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific 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: "google.cloud.common.OperationMetadata" + }; + } + + // Restores an existing instance's file share from a backup. + // + // The capacity of the instance needs to be equal to or larger than the + // capacity of the backup (and also equal to or larger than the minimum + // capacity of the tier). + rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/instances/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes an 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: "google.cloud.common.OperationMetadata" + }; + } + + // Lists all backups in a project for either a specified location or for all + // locations. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } +} + +// Network configuration for the instance. +message NetworkConfig { + // Internet protocol versions supported by Cloud Filestore. + enum AddressMode { + // Internet protocol not set. + ADDRESS_MODE_UNSPECIFIED = 0; + + // Use the IPv4 internet protocol. + MODE_IPV4 = 1; + } + + // The name of the Google Compute Engine + // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. + string network = 1; + + // Internet protocol versions for which the instance has IP addresses + // assigned. For this version, only MODE_IPV4 is supported. + repeated AddressMode modes = 3; + + // A /29 CIDR block in one of the + // [internal IP address + // ranges](https://www.arin.net/knowledge/address_filters.html) that + // identifies the range of IP addresses reserved for this instance. For + // example, 10.0.0.0/29 or 192.168.0.0/29. The range you specify can't overlap + // with either existing subnets or assigned IP address ranges for other Cloud + // Filestore instances in the selected VPC network. + string reserved_ip_range = 4; + + // Output only. IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format + // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block + // 7}:{block 8}. + repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// File share configuration for the instance. +message FileShareConfig { + // The name of the file share (must be 16 characters or less). + string name = 1; + + // File share capacity in gigabytes (GB). + // Cloud Filestore defines 1 GB as 1024^3 bytes. + int64 capacity_gb = 2; + + // The source that this file share has been restored from. Empty if the file + // share is created from scratch. + oneof source { + // The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}, + // that this file share has been restored from. + string source_backup = 8 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 7; +} + +// NFS export options specifications. +message NfsExportOptions { + // The access mode. + enum AccessMode { + // AccessMode not set. + ACCESS_MODE_UNSPECIFIED = 0; + + // The client can only read the file share. + READ_ONLY = 1; + + // The client can read and write the file share (default). + READ_WRITE = 2; + } + + // The squash mode. + enum SquashMode { + // SquashMode not set. + SQUASH_MODE_UNSPECIFIED = 0; + + // The Root user has root access to the file share (default). + NO_ROOT_SQUASH = 1; + + // The Root user has squashed access to the anonymous uid/gid. + ROOT_SQUASH = 2; + } + + // List of either an IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // file share. + // Overlapping IP ranges are not allowed, both within and across + // NfsExportOptions. An error will be returned. + // The limit is 64 IP ranges/addresses for each FileShareConfig among all + // NfsExportOptions. + repeated string ip_ranges = 1; + + // Either READ_ONLY, for allowing only read requests on the exported + // directory, or READ_WRITE, for allowing both read and write requests. + // The default is READ_WRITE. + AccessMode access_mode = 2; + + // Either NO_ROOT_SQUASH, for allowing root access on the exported directory, + // or ROOT_SQUASH, for not allowing root access. The default is + // NO_ROOT_SQUASH. + SquashMode squash_mode = 3; + + // An integer representing the anonymous user id with a default value of + // 65534. + // Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_uid = 4; + + // An integer representing the anonymous group id with a default value of + // 65534. + // Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_gid = 5; +} + +// A Cloud Filestore instance. +message Instance { + option (google.api.resource) = { + type: "file.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // The instance state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance is available for use. + READY = 2; + + // Work is being done on the instance. You can get further details from the + // `statusMessage` field of the `Instance` resource. + REPAIRING = 3; + + // The instance is shutting down. + DELETING = 4; + + // The instance is experiencing an issue and might be unusable. You can get + // further details from the `statusMessage` field of the `Instance` + // resource. + ERROR = 6; + + // The instance is restoring a backup to an existing file share and may be + // unusable during this time. + RESTORING = 7; + } + + // Available service tiers. + enum Tier { + // Not set. + TIER_UNSPECIFIED = 0; + + // STANDARD tier. + STANDARD = 1; + + // PREMIUM tier. + PREMIUM = 2; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_HDD is an alias for STANDARD Tier, offering economical + // performance backed by HDD. + BASIC_HDD = 3; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_SSD is an alias for PREMIUM Tier, and offers improved + // performance backed by SSD. + BASIC_SSD = 4; + + // HIGH_SCALE instances offer expanded capacity and performance scaling + // capabilities. + HIGH_SCALE_SSD = 5; + } + + // Output only. The resource name of the instance, in the format + // projects/{project}/locations/{location}/instances/{instance}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of the instance (2048 characters or less). + string description = 2; + + // Output only. The instance state. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the instance state, if available. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The service tier of the instance. + Tier tier = 8; + + // Resource labels to represent user provided metadata. + map labels = 9; + + // File system shares on the instance. + // For this version, only a single file share is supported. + repeated FileShareConfig file_shares = 10; + + // VPC networks to which the instance is connected. + // For this version, only a single network is supported. + repeated NetworkConfig networks = 11; + + // Server-specified ETag for the instance resource to prevent simultaneous + // updates from overwriting each other. + string etag = 12; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateInstanceRequest creates an instance. +message CreateInstanceRequest { + // Required. The instance's project and location, in the format + // projects/{project_id}/locations/{location}. In Cloud Filestore, + // locations map to GCP zones, for example **us-west1-b**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The name of the instance to create. + // The name must be unique for the specified project and location. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [instance resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.instances) + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetInstanceRequest gets the state of an instance. +message GetInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// UpdateInstanceRequest updates the settings of an instance. +message UpdateInstanceRequest { + // Mask of fields to update. At least one path must be supplied in this + // field. The elements of the repeated paths field may only include these + // fields: + // + // * "description" + // * "file_shares" + // * "labels" + google.protobuf.FieldMask update_mask = 1; + + // Only fields specified in update_mask are updated. + Instance instance = 2; +} + +// RestoreInstanceRequest restores an existing instances's file share from a +// backup. +message RestoreInstanceRequest { + // Required. The resource name of the instance, in the format + // projects/{project_number}/locations/{location_id}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. Name of the file share in the Cloud Filestore instance that the backup + // is being restored to. + string file_share = 2 [(google.api.field_behavior) = REQUIRED]; + + oneof source { + // The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + string source_backup = 3 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } +} + +// DeleteInstanceRequest deletes an instance. +message DeleteInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// ListInstancesRequest lists instances. +message ListInstancesRequest { + // Required. The project and location for which to retrieve instance information, + // in the format projects/{project_id}/locations/{location}. In Cloud + // Filestore, locations map to GCP zones, for example **us-west1-b**. To + // retrieve instance information for all locations, use "-" for the {location} + // value. + 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; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListInstancesResponse is the result of ListInstancesRequest. +message ListInstancesResponse { + // A list of instances in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of instances from all locations. If any location is unreachable, the + // response will only return instances in reachable locations and the + // "unreachable" field will be populated with a list of unreachable locations. + repeated Instance instances = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// A Cloud Filestore backup. +message Backup { + option (google.api.resource) = { + type: "file.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // The backup state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Backup is being created. + CREATING = 1; + + // Backup has been taken and the operation is being finalized. At this + // point, changes to the file share will not be reflected in the backup. + FINALIZING = 2; + + // Backup is available for use. + READY = 3; + + // Backup is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the backup, in the format + // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of the backup with 2048 characters or less. + // Requests with longer descriptions will be rejected. + string description = 2; + + // Output only. The backup state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the backup was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 5; + + // Output only. Capacity of the source file share when the backup was created. + int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the storage used by the backup. As backups share storage, + // this number is expected to change with backup creation/deletion. + int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource name of the source Cloud Filestore instance, in the format + // projects/{project_number}/locations/{location_id}/instances/{instance_id}, + // used to create this backup. + string source_instance = 8 [(google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + }]; + + // Name of the file share in the source Cloud Filestore instance that the + // backup is created from. + string source_file_share = 9; + + // Output only. The service tier of the source Cloud Filestore instance that this backup + // is created from. + Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Amount of bytes that will be downloaded if the backup is restored. This + // may be different than storage bytes, since sequential backups of the same + // disk will share storage. + int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateBackupRequest creates a backup. +message CreateBackupRequest { + // Required. The backup's project and location, in the format + // projects/{project_number}/locations/{location}. In Cloud Filestore, + // backup locations map to GCP regions, for example **us-west1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the backup. + // The ID must be unique within the specified project and location. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + // Values that do not match this pattern will trigger an INVALID_ARGUMENT + // error. + string backup_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// DeleteBackupRequest deletes a backup. +message DeleteBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_number}/locations/{location}/backups/{backup_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// UpdateBackupRequest updates description and/or labels for a backup. +message UpdateBackupRequest { + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// GetBackupRequest gets the state of a backup. +message GetBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_number}/locations/{location}/backups/{backup_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// ListBackupsRequest lists backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup information, + // in the format projects/{project_number}/locations/{location}. + // In Cloud Filestore, backup locations map to GCP regions, + // for example **us-west1**. + // To retrieve backup information for all locations, use "-" for the + // {location} value. + 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; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListBackupsResponse is the result of ListBackupsRequest. +message ListBackupsResponse { + // A list of backups in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of backups from all locations. If any location is unreachable, the + // response will only return backups in reachable locations and the + // "unreachable" field will be populated with a list of unreachable + // locations. + repeated Backup backups = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto new file mode 100644 index 00000000000..77b246c745a --- /dev/null +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -0,0 +1,732 @@ +// 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.filestore.v1beta1; + +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"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.Filestore.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/filestore/v1beta1;filestore"; +option java_multiple_files = true; +option java_outer_classname = "CloudFilestoreServiceProto"; +option java_package = "com.google.cloud.filestore.v1beta1"; +option php_namespace = "Google\\Cloud\\Filestore\\V1beta1"; + +option (google.api.resource_definition) = { + type: "file.googleapis.com/Snapshot" + pattern: "projects/{project}/locations/{location}/snapshots/{snapshot}" +}; + +// Configures and manages Cloud Filestore resources. +// +// Cloud Filestore Manager v1beta1. +// +// The `file.googleapis.com` service implements the Cloud Filestore API and +// defines the following model for managing resources: +// * The service works with a collection of cloud projects, named: `/projects/*` +// * Each project has a collection of available locations, named: `/locations/*` +// * Each location has a collection of instances and backups, named: +// `/instances/*` and `/backups/*` respectively. +// * As such, Cloud Filestore instances are resources of the form: +// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` +// backups are resources of the form: +// `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` +// +// Note that location_id can represent a GCP `zone` or `region` depending on the +// resource. +// for example: +// A zonal Filestore instance: +// * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer` +// A regional Filestore instance: +// * `projects/my-project/locations/us-central1/instances/my-enterprise-filer` +service CloudFilestoreManager { + option (google.api.default_host) = "file.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Lists all instances in a project for either a specified location + // or for all locations. + rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/instances" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific instance. + rpc GetInstance(GetInstanceRequest) returns (Instance) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates an instance. + // When creating from a backup, the capacity of the new instance needs to be + // equal to or larger than the capacity of the backup (and also equal to or + // larger than the minimum capacity of the tier). + 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: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific 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: "google.cloud.common.OperationMetadata" + }; + } + + // Restores an existing instance's file share from a backup. + // + // The capacity of the instance needs to be equal to or larger than the + // capacity of the backup (and also equal to or larger than the minimum + // capacity of the tier). + rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:restore" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes an 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: "google.cloud.common.OperationMetadata" + }; + } + + // Lists all backups in a project for either a specified location or for all + // locations. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a backup. + rpc CreateBackup(CreateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/backups" + body: "backup" + }; + option (google.api.method_signature) = "parent,backup,backup_id"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{backup.name=projects/*/locations/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } +} + +// Network configuration for the instance. +message NetworkConfig { + // Internet protocol versions supported by Cloud Filestore. + enum AddressMode { + // Internet protocol not set. + ADDRESS_MODE_UNSPECIFIED = 0; + + // Use the IPv4 internet protocol. + MODE_IPV4 = 1; + } + + // The name of the Google Compute Engine + // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // instance is connected. + string network = 1; + + // Internet protocol versions for which the instance has IP addresses + // assigned. For this version, only MODE_IPV4 is supported. + repeated AddressMode modes = 3; + + // A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the + // [internal IP address + // ranges](https://www.arin.net/knowledge/address_filters.html) that + // identifies the range of IP addresses reserved for this instance. For + // example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap + // with either existing subnets or assigned IP address ranges for other Cloud + // Filestore instances in the selected VPC network. + string reserved_ip_range = 4; + + // Output only. IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format + // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block + // 7}:{block 8}. + repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// File share configuration for the instance. +message FileShareConfig { + // The name of the file share (must be 16 characters or less). + string name = 1; + + // File share capacity in gigabytes (GB). + // Cloud Filestore defines 1 GB as 1024^3 bytes. + int64 capacity_gb = 2; + + // The source that this file share has been restored from. Empty if the file + // share is created from scratch. + oneof source { + // The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}, that + // this file share has been restored from. + string source_backup = 9 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 8; +} + +// NFS export options specifications. +message NfsExportOptions { + // The access mode. + enum AccessMode { + // AccessMode not set. + ACCESS_MODE_UNSPECIFIED = 0; + + // The client can only read the file share. + READ_ONLY = 1; + + // The client can read and write the file share (default). + READ_WRITE = 2; + } + + // The squash mode. + enum SquashMode { + // SquashMode not set. + SQUASH_MODE_UNSPECIFIED = 0; + + // The Root user has root access to the file share (default). + NO_ROOT_SQUASH = 1; + + // The Root user has squashed access to the anonymous uid/gid. + ROOT_SQUASH = 2; + } + + // List of either an IPv4 addresses in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format + // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // file share. + // Overlapping IP ranges are not allowed, both within and across + // NfsExportOptions. An error will be returned. + // The limit is 64 IP ranges/addresses for each FileShareConfig among all + // NfsExportOptions. + repeated string ip_ranges = 1; + + // Either READ_ONLY, for allowing only read requests on the exported + // directory, or READ_WRITE, for allowing both read and write requests. + // The default is READ_WRITE. + AccessMode access_mode = 2; + + // Either NO_ROOT_SQUASH, for allowing root access on the exported directory, + // or ROOT_SQUASH, for not allowing root access. The default is + // NO_ROOT_SQUASH. + SquashMode squash_mode = 3; + + // An integer representing the anonymous user id with a default value of + // 65534. + // Anon_uid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_uid = 4; + + // An integer representing the anonymous group id with a default value of + // 65534. + // Anon_gid may only be set with squash_mode of ROOT_SQUASH. An error will be + // returned if this field is specified for other squash_mode settings. + int64 anon_gid = 5; +} + +// A Cloud Filestore instance. +message Instance { + option (google.api.resource) = { + type: "file.googleapis.com/Instance" + pattern: "projects/{project}/locations/{location}/instances/{instance}" + }; + + // The instance state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance is available for use. + READY = 2; + + // Work is being done on the instance. You can get further details from the + // `statusMessage` field of the `Instance` resource. + REPAIRING = 3; + + // The instance is shutting down. + DELETING = 4; + + // The instance is experiencing an issue and might be unusable. You can get + // further details from the `statusMessage` field of the `Instance` + // resource. + ERROR = 6; + + // The instance is restoring a snapshot or backup to an existing file share + // and may be unusable during this time. + RESTORING = 7; + } + + // Available service tiers. + enum Tier { + // Not set. + TIER_UNSPECIFIED = 0; + + // STANDARD tier. BASIC_HDD is the preferred term for this tier. + STANDARD = 1; + + // PREMIUM tier. BASIC_SSD is the preferred term for this tier. + PREMIUM = 2; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_HDD is an alias for STANDARD Tier, offering economical + // performance backed by HDD. + BASIC_HDD = 3; + + // BASIC instances offer a maximum capacity of 63.9 TB. + // BASIC_SSD is an alias for PREMIUM Tier, and offers improved + // performance backed by SSD. + BASIC_SSD = 4; + + // HIGH_SCALE instances offer expanded capacity and performance scaling + // capabilities. + HIGH_SCALE_SSD = 6; + } + + // Output only. The resource name of the instance, in the format + // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The description of the instance (2048 characters or less). + string description = 2; + + // Output only. The instance state. + State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Additional information about the instance state, if available. + string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The service tier of the instance. + Tier tier = 8; + + // Resource labels to represent user provided metadata. + map labels = 9; + + // File system shares on the instance. + // For this version, only a single file share is supported. + repeated FileShareConfig file_shares = 10; + + // VPC networks to which the instance is connected. + // For this version, only a single network is supported. + repeated NetworkConfig networks = 11; + + // Server-specified ETag for the instance resource to prevent simultaneous + // updates from overwriting each other. + string etag = 12; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateInstanceRequest creates an instance. +message CreateInstanceRequest { + // Required. The instance's project and location, in the format + // projects/{project_id}/locations/{location}. In Cloud Filestore, + // locations map to GCP zones, for example **us-west1-b**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The ID of the instance to create. + // The ID must be unique within the specified project and location. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [instance resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetInstanceRequest gets the state of an instance. +message GetInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// UpdateInstanceRequest updates the settings of an instance. +message UpdateInstanceRequest { + // Required. Mask of fields to update. At least one path must be supplied in this + // field. The elements of the repeated paths field may only include these + // fields: + // + // * "description" + // * "file_shares" + // * "labels" + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Only fields specified in update_mask are updated. + Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// RestoreInstanceRequest restores an existing instances's file share from a +// snapshot or backup. +message RestoreInstanceRequest { + // Required. The resource name of the instance, in the format + // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. Name of the file share in the Cloud Filestore instance that the snapshot + // is being restored to. + string file_share = 2 [(google.api.field_behavior) = REQUIRED]; + + oneof source { + // The resource name of the snapshot, in the format + // projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}. + string source_snapshot = 3 [(google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + }]; + + // The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + string source_backup = 4 [(google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + }]; + } +} + +// DeleteInstanceRequest deletes an instance. +message DeleteInstanceRequest { + // Required. The instance resource name, in the format + // projects/{project_id}/locations/{location}/instances/{instance_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; +} + +// ListInstancesRequest lists instances. +message ListInstancesRequest { + // Required. The project and location for which to retrieve instance information, + // in the format projects/{project_id}/locations/{location}. In Cloud + // Filestore, locations map to GCP zones, for example **us-west1-b**. To + // retrieve instance information for all locations, use "-" for the {location} + // value. + 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; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListInstancesResponse is the result of ListInstancesRequest. +message ListInstancesResponse { + // A list of instances in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of instances from all locations. If any location is unreachable, the + // response will only return instances in reachable locations and the + // "unreachable" field will be populated with a list of unreachable locations. + repeated Instance instances = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// A Cloud Filestore backup. +message Backup { + option (google.api.resource) = { + type: "file.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backups/{backup}" + }; + + // The backup state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Backup is being created. + CREATING = 1; + + // Backup has been taken and the operation is being finalized. At this + // point, changes to the file share will not be reflected in the backup. + FINALIZING = 2; + + // Backup is available for use. + READY = 3; + + // Backup is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the backup, in the format + // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of the backup with 2048 characters or less. + // Requests with longer descriptions will be rejected. + string description = 2; + + // Output only. The backup state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the backup was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 5; + + // Output only. Capacity of the source file share when the backup was created. + int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The size of the storage used by the backup. As backups share storage, + // this number is expected to change with backup creation/deletion. + int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The resource name of the source Cloud Filestore instance, in the format + // projects/{project_id}/locations/{location_id}/instances/{instance_id}, + // used to create this backup. + string source_instance = 8 [(google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + }]; + + // Name of the file share in the source Cloud Filestore instance that the + // backup is created from. + string source_file_share = 9; + + // Output only. The service tier of the source Cloud Filestore instance that this backup + // is created from. + Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Amount of bytes that will be downloaded if the backup is restored + int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CreateBackupRequest creates a backup. +message CreateBackupRequest { + // Required. The backup's project and location, in the format + // projects/{project_id}/locations/{location}. In Cloud Filestore, + // backup locations map to GCP regions, for example **us-west1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the backup. + // The ID must be unique within the specified project and location. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string backup_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// DeleteBackupRequest deletes a backup. +message DeleteBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_id}/locations/{location}/backups/{backup_id} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// UpdateBackupRequest updates description and/or labels for a backup. +message UpdateBackupRequest { + // Required. A [backup resource] + // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// GetBackupRequest gets the state of a backup. +message GetBackupRequest { + // Required. The backup resource name, in the format + // projects/{project_id}/locations/{location}/backups/{backup_id}. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Backup" + } + ]; +} + +// ListBackupsRequest lists backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup information, + // in the format projects/{project_id}/locations/{location}. + // In Cloud Filestore, backup locations map to GCP regions, + // for example **us-west1**. + // To retrieve backup information for all locations, use "-" for the + // {location} value. + 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; + + // The next_page_token value to use if there are additional + // results to retrieve for this list request. + string page_token = 3; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListBackupsResponse is the result of ListBackupsRequest. +message ListBackupsResponse { + // A list of backups in the project for the specified location. + // + // If the {location} value in the request is "-", the response contains a list + // of backups from all locations. If any location is unreachable, the + // response will only return backups in reachable locations and the + // "unreachable" field will be populated with a list of unreachable + // locations. + repeated Backup backups = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts new file mode 100644 index 00000000000..01c10c4a824 --- /dev/null +++ b/packages/google-cloud-filestore/protos/protos.d.ts @@ -0,0 +1,10688 @@ +// 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 common. */ + namespace common { + + /** 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 cancelRequested */ + cancelRequested?: (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.common.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 cancelRequested. */ + public cancelRequested: 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.common.IOperationMetadata): google.cloud.common.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.common.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.common.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.common.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.common.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.common.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.common.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.common.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.common.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace filestore. */ + namespace filestore { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a CloudFilestoreManager */ + class CloudFilestoreManager extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudFilestoreManager 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 CloudFilestoreManager 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): CloudFilestoreManager; + + /** + * 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.filestore.v1.IListInstancesRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.filestore.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.filestore.v1.IGetInstanceRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.filestore.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.filestore.v1.ICreateInstanceRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.filestore.v1.ICreateInstanceRequest): 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.filestore.v1.IUpdateInstanceRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.filestore.v1.IUpdateInstanceRequest): Promise; + + /** + * Calls RestoreInstance. + * @param request RestoreInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreInstance(request: google.cloud.filestore.v1.IRestoreInstanceRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstanceCallback): void; + + /** + * Calls RestoreInstance. + * @param request RestoreInstanceRequest message or plain object + * @returns Promise + */ + public restoreInstance(request: google.cloud.filestore.v1.IRestoreInstanceRequest): 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.filestore.v1.IDeleteInstanceRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.filestore.v1.IDeleteInstanceRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.filestore.v1.IListBackupsRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.filestore.v1.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.filestore.v1.IGetBackupRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.filestore.v1.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.filestore.v1.ICreateBackupRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.filestore.v1.ICreateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.filestore.v1.IDeleteBackupRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.filestore.v1.IDeleteBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.filestore.v1.IUpdateBackupRequest, callback: google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.filestore.v1.IUpdateBackupRequest): Promise; + } + + namespace CloudFilestoreManager { + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.filestore.v1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.filestore.v1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#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.filestore.v1.CloudFilestoreManager#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.filestore.v1.CloudFilestoreManager#restoreInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#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.filestore.v1.CloudFilestoreManager#listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.filestore.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.filestore.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig modes */ + modes?: (google.cloud.filestore.v1.NetworkConfig.AddressMode[]|null); + + /** NetworkConfig reservedIpRange */ + reservedIpRange?: (string|null); + + /** NetworkConfig ipAddresses */ + ipAddresses?: (string[]|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig modes. */ + public modes: google.cloud.filestore.v1.NetworkConfig.AddressMode[]; + + /** NetworkConfig reservedIpRange. */ + public reservedIpRange: string; + + /** NetworkConfig ipAddresses. */ + public ipAddresses: string[]; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.filestore.v1.INetworkConfig): google.cloud.filestore.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkConfig { + + /** AddressMode enum. */ + enum AddressMode { + ADDRESS_MODE_UNSPECIFIED = 0, + MODE_IPV4 = 1 + } + } + + /** Properties of a FileShareConfig. */ + interface IFileShareConfig { + + /** FileShareConfig name */ + name?: (string|null); + + /** FileShareConfig capacityGb */ + capacityGb?: (number|Long|string|null); + + /** FileShareConfig sourceBackup */ + sourceBackup?: (string|null); + + /** FileShareConfig nfsExportOptions */ + nfsExportOptions?: (google.cloud.filestore.v1.INfsExportOptions[]|null); + } + + /** Represents a FileShareConfig. */ + class FileShareConfig implements IFileShareConfig { + + /** + * Constructs a new FileShareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IFileShareConfig); + + /** FileShareConfig name. */ + public name: string; + + /** FileShareConfig capacityGb. */ + public capacityGb: (number|Long|string); + + /** FileShareConfig sourceBackup. */ + public sourceBackup?: (string|null); + + /** FileShareConfig nfsExportOptions. */ + public nfsExportOptions: google.cloud.filestore.v1.INfsExportOptions[]; + + /** FileShareConfig source. */ + public source?: "sourceBackup"; + + /** + * Creates a new FileShareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FileShareConfig instance + */ + public static create(properties?: google.cloud.filestore.v1.IFileShareConfig): google.cloud.filestore.v1.FileShareConfig; + + /** + * Encodes the specified FileShareConfig message. Does not implicitly {@link google.cloud.filestore.v1.FileShareConfig.verify|verify} messages. + * @param message FileShareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IFileShareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileShareConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.FileShareConfig.verify|verify} messages. + * @param message FileShareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IFileShareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileShareConfig + * @throws {Error} If the payload is not 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.filestore.v1.FileShareConfig; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileShareConfig + * @throws {Error} If the payload 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.filestore.v1.FileShareConfig; + + /** + * Verifies a FileShareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileShareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileShareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.FileShareConfig; + + /** + * Creates a plain object from a FileShareConfig message. Also converts values to other types if specified. + * @param message FileShareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.FileShareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileShareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NfsExportOptions. */ + interface INfsExportOptions { + + /** NfsExportOptions ipRanges */ + ipRanges?: (string[]|null); + + /** NfsExportOptions accessMode */ + accessMode?: (google.cloud.filestore.v1.NfsExportOptions.AccessMode|keyof typeof google.cloud.filestore.v1.NfsExportOptions.AccessMode|null); + + /** NfsExportOptions squashMode */ + squashMode?: (google.cloud.filestore.v1.NfsExportOptions.SquashMode|keyof typeof google.cloud.filestore.v1.NfsExportOptions.SquashMode|null); + + /** NfsExportOptions anonUid */ + anonUid?: (number|Long|string|null); + + /** NfsExportOptions anonGid */ + anonGid?: (number|Long|string|null); + } + + /** Represents a NfsExportOptions. */ + class NfsExportOptions implements INfsExportOptions { + + /** + * Constructs a new NfsExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.INfsExportOptions); + + /** NfsExportOptions ipRanges. */ + public ipRanges: string[]; + + /** NfsExportOptions accessMode. */ + public accessMode: (google.cloud.filestore.v1.NfsExportOptions.AccessMode|keyof typeof google.cloud.filestore.v1.NfsExportOptions.AccessMode); + + /** NfsExportOptions squashMode. */ + public squashMode: (google.cloud.filestore.v1.NfsExportOptions.SquashMode|keyof typeof google.cloud.filestore.v1.NfsExportOptions.SquashMode); + + /** NfsExportOptions anonUid. */ + public anonUid: (number|Long|string); + + /** NfsExportOptions anonGid. */ + public anonGid: (number|Long|string); + + /** + * Creates a new NfsExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns NfsExportOptions instance + */ + public static create(properties?: google.cloud.filestore.v1.INfsExportOptions): google.cloud.filestore.v1.NfsExportOptions; + + /** + * Encodes the specified NfsExportOptions message. Does not implicitly {@link google.cloud.filestore.v1.NfsExportOptions.verify|verify} messages. + * @param message NfsExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.INfsExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NfsExportOptions message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.NfsExportOptions.verify|verify} messages. + * @param message NfsExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.INfsExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NfsExportOptions + * @throws {Error} If the payload is not 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.filestore.v1.NfsExportOptions; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NfsExportOptions + * @throws {Error} If the payload 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.filestore.v1.NfsExportOptions; + + /** + * Verifies a NfsExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NfsExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NfsExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.NfsExportOptions; + + /** + * Creates a plain object from a NfsExportOptions message. Also converts values to other types if specified. + * @param message NfsExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.NfsExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NfsExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NfsExportOptions { + + /** AccessMode enum. */ + enum AccessMode { + ACCESS_MODE_UNSPECIFIED = 0, + READ_ONLY = 1, + READ_WRITE = 2 + } + + /** SquashMode enum. */ + enum SquashMode { + SQUASH_MODE_UNSPECIFIED = 0, + NO_ROOT_SQUASH = 1, + ROOT_SQUASH = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance state */ + state?: (google.cloud.filestore.v1.Instance.State|keyof typeof google.cloud.filestore.v1.Instance.State|null); + + /** Instance statusMessage */ + statusMessage?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance tier */ + tier?: (google.cloud.filestore.v1.Instance.Tier|keyof typeof google.cloud.filestore.v1.Instance.Tier|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance fileShares */ + fileShares?: (google.cloud.filestore.v1.IFileShareConfig[]|null); + + /** Instance networks */ + networks?: (google.cloud.filestore.v1.INetworkConfig[]|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance state. */ + public state: (google.cloud.filestore.v1.Instance.State|keyof typeof google.cloud.filestore.v1.Instance.State); + + /** Instance statusMessage. */ + public statusMessage: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance tier. */ + public tier: (google.cloud.filestore.v1.Instance.Tier|keyof typeof google.cloud.filestore.v1.Instance.Tier); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance fileShares. */ + public fileShares: google.cloud.filestore.v1.IFileShareConfig[]; + + /** Instance networks. */ + public networks: google.cloud.filestore.v1.INetworkConfig[]; + + /** Instance etag. */ + public etag: string; + + /** Instance satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.filestore.v1.IInstance): google.cloud.filestore.v1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + REPAIRING = 3, + DELETING = 4, + ERROR = 6, + RESTORING = 7 + } + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + STANDARD = 1, + PREMIUM = 2, + BASIC_HDD = 3, + BASIC_SSD = 4, + HIGH_SCALE_SSD = 5 + } + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.filestore.v1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.filestore.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.filestore.v1.ICreateInstanceRequest): google.cloud.filestore.v1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest 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.filestore.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.filestore.v1.IGetInstanceRequest): google.cloud.filestore.v1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.filestore.v1.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.filestore.v1.IInstance|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IUpdateInstanceRequest): google.cloud.filestore.v1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestoreInstanceRequest. */ + interface IRestoreInstanceRequest { + + /** RestoreInstanceRequest name */ + name?: (string|null); + + /** RestoreInstanceRequest fileShare */ + fileShare?: (string|null); + + /** RestoreInstanceRequest sourceBackup */ + sourceBackup?: (string|null); + } + + /** Represents a RestoreInstanceRequest. */ + class RestoreInstanceRequest implements IRestoreInstanceRequest { + + /** + * Constructs a new RestoreInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IRestoreInstanceRequest); + + /** RestoreInstanceRequest name. */ + public name: string; + + /** RestoreInstanceRequest fileShare. */ + public fileShare: string; + + /** RestoreInstanceRequest sourceBackup. */ + public sourceBackup?: (string|null); + + /** RestoreInstanceRequest source. */ + public source?: "sourceBackup"; + + /** + * Creates a new RestoreInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInstanceRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IRestoreInstanceRequest): google.cloud.filestore.v1.RestoreInstanceRequest; + + /** + * Encodes the specified RestoreInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.RestoreInstanceRequest.verify|verify} messages. + * @param message RestoreInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IRestoreInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.RestoreInstanceRequest.verify|verify} messages. + * @param message RestoreInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IRestoreInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInstanceRequest + * @throws {Error} If the payload is not 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.filestore.v1.RestoreInstanceRequest; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInstanceRequest + * @throws {Error} If the payload 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.filestore.v1.RestoreInstanceRequest; + + /** + * Verifies a RestoreInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.RestoreInstanceRequest; + + /** + * Creates a plain object from a RestoreInstanceRequest message. Also converts values to other types if specified. + * @param message RestoreInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.RestoreInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInstanceRequest 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.filestore.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.filestore.v1.IDeleteInstanceRequest): google.cloud.filestore.v1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IListInstancesRequest): google.cloud.filestore.v1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.filestore.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.filestore.v1.IListInstancesResponse): google.cloud.filestore.v1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup state */ + state?: (google.cloud.filestore.v1.Backup.State|keyof typeof google.cloud.filestore.v1.Backup.State|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup capacityGb */ + capacityGb?: (number|Long|string|null); + + /** Backup storageBytes */ + storageBytes?: (number|Long|string|null); + + /** Backup sourceInstance */ + sourceInstance?: (string|null); + + /** Backup sourceFileShare */ + sourceFileShare?: (string|null); + + /** Backup sourceInstanceTier */ + sourceInstanceTier?: (google.cloud.filestore.v1.Instance.Tier|keyof typeof google.cloud.filestore.v1.Instance.Tier|null); + + /** Backup downloadBytes */ + downloadBytes?: (number|Long|string|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description: string; + + /** Backup state. */ + public state: (google.cloud.filestore.v1.Backup.State|keyof typeof google.cloud.filestore.v1.Backup.State); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup capacityGb. */ + public capacityGb: (number|Long|string); + + /** Backup storageBytes. */ + public storageBytes: (number|Long|string); + + /** Backup sourceInstance. */ + public sourceInstance: string; + + /** Backup sourceFileShare. */ + public sourceFileShare: string; + + /** Backup sourceInstanceTier. */ + public sourceInstanceTier: (google.cloud.filestore.v1.Instance.Tier|keyof typeof google.cloud.filestore.v1.Instance.Tier); + + /** Backup downloadBytes. */ + public downloadBytes: (number|Long|string); + + /** Backup satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.filestore.v1.IBackup): google.cloud.filestore.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not 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.filestore.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload 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.filestore.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + FINALIZING = 2, + READY = 3, + DELETING = 4 + } + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.filestore.v1.IBackup|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1.IBackup|null); + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.ICreateBackupRequest): google.cloud.filestore.v1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload 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.filestore.v1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IDeleteBackupRequest): google.cloud.filestore.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload 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.filestore.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.filestore.v1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IUpdateBackupRequest): google.cloud.filestore.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload 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.filestore.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IGetBackupRequest): google.cloud.filestore.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload 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.filestore.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.filestore.v1.IListBackupsRequest): google.cloud.filestore.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not 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.filestore.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload 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.filestore.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.filestore.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.filestore.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.filestore.v1.IListBackupsResponse): google.cloud.filestore.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not 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.filestore.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload 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.filestore.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Represents a CloudFilestoreManager */ + class CloudFilestoreManager extends $protobuf.rpc.Service { + + /** + * Constructs a new CloudFilestoreManager 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 CloudFilestoreManager 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): CloudFilestoreManager; + + /** + * 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.filestore.v1beta1.IListInstancesRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstancesCallback): void; + + /** + * Calls ListInstances. + * @param request ListInstancesRequest message or plain object + * @returns Promise + */ + public listInstances(request: google.cloud.filestore.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.filestore.v1beta1.IGetInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstanceCallback): void; + + /** + * Calls GetInstance. + * @param request GetInstanceRequest message or plain object + * @returns Promise + */ + public getInstance(request: google.cloud.filestore.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.filestore.v1beta1.ICreateInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstanceCallback): void; + + /** + * Calls CreateInstance. + * @param request CreateInstanceRequest message or plain object + * @returns Promise + */ + public createInstance(request: google.cloud.filestore.v1beta1.ICreateInstanceRequest): 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.filestore.v1beta1.IUpdateInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstanceCallback): void; + + /** + * Calls UpdateInstance. + * @param request UpdateInstanceRequest message or plain object + * @returns Promise + */ + public updateInstance(request: google.cloud.filestore.v1beta1.IUpdateInstanceRequest): Promise; + + /** + * Calls RestoreInstance. + * @param request RestoreInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreInstance(request: google.cloud.filestore.v1beta1.IRestoreInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstanceCallback): void; + + /** + * Calls RestoreInstance. + * @param request RestoreInstanceRequest message or plain object + * @returns Promise + */ + public restoreInstance(request: google.cloud.filestore.v1beta1.IRestoreInstanceRequest): 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.filestore.v1beta1.IDeleteInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstanceCallback): void; + + /** + * Calls DeleteInstance. + * @param request DeleteInstanceRequest message or plain object + * @returns Promise + */ + public deleteInstance(request: google.cloud.filestore.v1beta1.IDeleteInstanceRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.filestore.v1beta1.IListBackupsRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.filestore.v1beta1.IListBackupsRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.filestore.v1beta1.IGetBackupRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.filestore.v1beta1.IGetBackupRequest): Promise; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackup(request: google.cloud.filestore.v1beta1.ICreateBackupRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackupCallback): void; + + /** + * Calls CreateBackup. + * @param request CreateBackupRequest message or plain object + * @returns Promise + */ + public createBackup(request: google.cloud.filestore.v1beta1.ICreateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.filestore.v1beta1.IDeleteBackupRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.filestore.v1beta1.IDeleteBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.filestore.v1beta1.IUpdateBackupRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.filestore.v1beta1.IUpdateBackupRequest): Promise; + } + + namespace CloudFilestoreManager { + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listInstances}. + * @param error Error, if any + * @param [response] ListInstancesResponse + */ + type ListInstancesCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListInstancesResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getInstance}. + * @param error Error, if any + * @param [response] Instance + */ + type GetInstanceCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Instance) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#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.filestore.v1beta1.CloudFilestoreManager#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.filestore.v1beta1.CloudFilestoreManager#restoreInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#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.filestore.v1beta1.CloudFilestoreManager#listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig modes */ + modes?: (google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[]|null); + + /** NetworkConfig reservedIpRange */ + reservedIpRange?: (string|null); + + /** NetworkConfig ipAddresses */ + ipAddresses?: (string[]|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig modes. */ + public modes: google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[]; + + /** NetworkConfig reservedIpRange. */ + public reservedIpRange: string; + + /** NetworkConfig ipAddresses. */ + public ipAddresses: string[]; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.INetworkConfig): google.cloud.filestore.v1beta1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NetworkConfig { + + /** AddressMode enum. */ + enum AddressMode { + ADDRESS_MODE_UNSPECIFIED = 0, + MODE_IPV4 = 1 + } + } + + /** Properties of a FileShareConfig. */ + interface IFileShareConfig { + + /** FileShareConfig name */ + name?: (string|null); + + /** FileShareConfig capacityGb */ + capacityGb?: (number|Long|string|null); + + /** FileShareConfig sourceBackup */ + sourceBackup?: (string|null); + + /** FileShareConfig nfsExportOptions */ + nfsExportOptions?: (google.cloud.filestore.v1beta1.INfsExportOptions[]|null); + } + + /** Represents a FileShareConfig. */ + class FileShareConfig implements IFileShareConfig { + + /** + * Constructs a new FileShareConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IFileShareConfig); + + /** FileShareConfig name. */ + public name: string; + + /** FileShareConfig capacityGb. */ + public capacityGb: (number|Long|string); + + /** FileShareConfig sourceBackup. */ + public sourceBackup?: (string|null); + + /** FileShareConfig nfsExportOptions. */ + public nfsExportOptions: google.cloud.filestore.v1beta1.INfsExportOptions[]; + + /** FileShareConfig source. */ + public source?: "sourceBackup"; + + /** + * Creates a new FileShareConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns FileShareConfig instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IFileShareConfig): google.cloud.filestore.v1beta1.FileShareConfig; + + /** + * Encodes the specified FileShareConfig message. Does not implicitly {@link google.cloud.filestore.v1beta1.FileShareConfig.verify|verify} messages. + * @param message FileShareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IFileShareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileShareConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.FileShareConfig.verify|verify} messages. + * @param message FileShareConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IFileShareConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileShareConfig + * @throws {Error} If the payload is not 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.filestore.v1beta1.FileShareConfig; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileShareConfig + * @throws {Error} If the payload 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.filestore.v1beta1.FileShareConfig; + + /** + * Verifies a FileShareConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileShareConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileShareConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.FileShareConfig; + + /** + * Creates a plain object from a FileShareConfig message. Also converts values to other types if specified. + * @param message FileShareConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.FileShareConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileShareConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NfsExportOptions. */ + interface INfsExportOptions { + + /** NfsExportOptions ipRanges */ + ipRanges?: (string[]|null); + + /** NfsExportOptions accessMode */ + accessMode?: (google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode|keyof typeof google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode|null); + + /** NfsExportOptions squashMode */ + squashMode?: (google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode|keyof typeof google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode|null); + + /** NfsExportOptions anonUid */ + anonUid?: (number|Long|string|null); + + /** NfsExportOptions anonGid */ + anonGid?: (number|Long|string|null); + } + + /** Represents a NfsExportOptions. */ + class NfsExportOptions implements INfsExportOptions { + + /** + * Constructs a new NfsExportOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.INfsExportOptions); + + /** NfsExportOptions ipRanges. */ + public ipRanges: string[]; + + /** NfsExportOptions accessMode. */ + public accessMode: (google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode|keyof typeof google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode); + + /** NfsExportOptions squashMode. */ + public squashMode: (google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode|keyof typeof google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode); + + /** NfsExportOptions anonUid. */ + public anonUid: (number|Long|string); + + /** NfsExportOptions anonGid. */ + public anonGid: (number|Long|string); + + /** + * Creates a new NfsExportOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns NfsExportOptions instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.INfsExportOptions): google.cloud.filestore.v1beta1.NfsExportOptions; + + /** + * Encodes the specified NfsExportOptions message. Does not implicitly {@link google.cloud.filestore.v1beta1.NfsExportOptions.verify|verify} messages. + * @param message NfsExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.INfsExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NfsExportOptions message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.NfsExportOptions.verify|verify} messages. + * @param message NfsExportOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.INfsExportOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NfsExportOptions + * @throws {Error} If the payload is not 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.filestore.v1beta1.NfsExportOptions; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NfsExportOptions + * @throws {Error} If the payload 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.filestore.v1beta1.NfsExportOptions; + + /** + * Verifies a NfsExportOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NfsExportOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NfsExportOptions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.NfsExportOptions; + + /** + * Creates a plain object from a NfsExportOptions message. Also converts values to other types if specified. + * @param message NfsExportOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.NfsExportOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NfsExportOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NfsExportOptions { + + /** AccessMode enum. */ + enum AccessMode { + ACCESS_MODE_UNSPECIFIED = 0, + READ_ONLY = 1, + READ_WRITE = 2 + } + + /** SquashMode enum. */ + enum SquashMode { + SQUASH_MODE_UNSPECIFIED = 0, + NO_ROOT_SQUASH = 1, + ROOT_SQUASH = 2 + } + } + + /** Properties of an Instance. */ + interface IInstance { + + /** Instance name */ + name?: (string|null); + + /** Instance description */ + description?: (string|null); + + /** Instance state */ + state?: (google.cloud.filestore.v1beta1.Instance.State|keyof typeof google.cloud.filestore.v1beta1.Instance.State|null); + + /** Instance statusMessage */ + statusMessage?: (string|null); + + /** Instance createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Instance tier */ + tier?: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier|null); + + /** Instance labels */ + labels?: ({ [k: string]: string }|null); + + /** Instance fileShares */ + fileShares?: (google.cloud.filestore.v1beta1.IFileShareConfig[]|null); + + /** Instance networks */ + networks?: (google.cloud.filestore.v1beta1.INetworkConfig[]|null); + + /** Instance etag */ + etag?: (string|null); + + /** Instance satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + } + + /** Represents an Instance. */ + class Instance implements IInstance { + + /** + * Constructs a new Instance. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IInstance); + + /** Instance name. */ + public name: string; + + /** Instance description. */ + public description: string; + + /** Instance state. */ + public state: (google.cloud.filestore.v1beta1.Instance.State|keyof typeof google.cloud.filestore.v1beta1.Instance.State); + + /** Instance statusMessage. */ + public statusMessage: string; + + /** Instance createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Instance tier. */ + public tier: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier); + + /** Instance labels. */ + public labels: { [k: string]: string }; + + /** Instance fileShares. */ + public fileShares: google.cloud.filestore.v1beta1.IFileShareConfig[]; + + /** Instance networks. */ + public networks: google.cloud.filestore.v1beta1.INetworkConfig[]; + + /** Instance etag. */ + public etag: string; + + /** Instance satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new Instance instance using the specified properties. + * @param [properties] Properties to set + * @returns Instance instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IInstance): google.cloud.filestore.v1beta1.Instance; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IInstance, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.Instance, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Instance to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Instance { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + REPAIRING = 3, + DELETING = 4, + ERROR = 6, + RESTORING = 7 + } + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + STANDARD = 1, + PREMIUM = 2, + BASIC_HDD = 3, + BASIC_SSD = 4, + HIGH_SCALE_SSD = 6 + } + } + + /** Properties of a CreateInstanceRequest. */ + interface ICreateInstanceRequest { + + /** CreateInstanceRequest parent */ + parent?: (string|null); + + /** CreateInstanceRequest instanceId */ + instanceId?: (string|null); + + /** CreateInstanceRequest instance */ + instance?: (google.cloud.filestore.v1beta1.IInstance|null); + } + + /** Represents a CreateInstanceRequest. */ + class CreateInstanceRequest implements ICreateInstanceRequest { + + /** + * Constructs a new CreateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.ICreateInstanceRequest); + + /** CreateInstanceRequest parent. */ + public parent: string; + + /** CreateInstanceRequest instanceId. */ + public instanceId: string; + + /** CreateInstanceRequest instance. */ + public instance?: (google.cloud.filestore.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.filestore.v1beta1.ICreateInstanceRequest): google.cloud.filestore.v1beta1.CreateInstanceRequest; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.ICreateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.CreateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateInstanceRequest 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.filestore.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.filestore.v1beta1.IGetInstanceRequest): google.cloud.filestore.v1beta1.GetInstanceRequest; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IGetInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.GetInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateInstanceRequest. */ + interface IUpdateInstanceRequest { + + /** UpdateInstanceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance */ + instance?: (google.cloud.filestore.v1beta1.IInstance|null); + } + + /** Represents an UpdateInstanceRequest. */ + class UpdateInstanceRequest implements IUpdateInstanceRequest { + + /** + * Constructs a new UpdateInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IUpdateInstanceRequest); + + /** UpdateInstanceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateInstanceRequest instance. */ + public instance?: (google.cloud.filestore.v1beta1.IInstance|null); + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateInstanceRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IUpdateInstanceRequest): google.cloud.filestore.v1beta1.UpdateInstanceRequest; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IUpdateInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.UpdateInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestoreInstanceRequest. */ + interface IRestoreInstanceRequest { + + /** RestoreInstanceRequest name */ + name?: (string|null); + + /** RestoreInstanceRequest fileShare */ + fileShare?: (string|null); + + /** RestoreInstanceRequest sourceSnapshot */ + sourceSnapshot?: (string|null); + + /** RestoreInstanceRequest sourceBackup */ + sourceBackup?: (string|null); + } + + /** Represents a RestoreInstanceRequest. */ + class RestoreInstanceRequest implements IRestoreInstanceRequest { + + /** + * Constructs a new RestoreInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IRestoreInstanceRequest); + + /** RestoreInstanceRequest name. */ + public name: string; + + /** RestoreInstanceRequest fileShare. */ + public fileShare: string; + + /** RestoreInstanceRequest sourceSnapshot. */ + public sourceSnapshot?: (string|null); + + /** RestoreInstanceRequest sourceBackup. */ + public sourceBackup?: (string|null); + + /** RestoreInstanceRequest source. */ + public source?: ("sourceSnapshot"|"sourceBackup"); + + /** + * Creates a new RestoreInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreInstanceRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IRestoreInstanceRequest): google.cloud.filestore.v1beta1.RestoreInstanceRequest; + + /** + * Encodes the specified RestoreInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.RestoreInstanceRequest.verify|verify} messages. + * @param message RestoreInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IRestoreInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.RestoreInstanceRequest.verify|verify} messages. + * @param message RestoreInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IRestoreInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreInstanceRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.RestoreInstanceRequest; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreInstanceRequest + * @throws {Error} If the payload 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.filestore.v1beta1.RestoreInstanceRequest; + + /** + * Verifies a RestoreInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.RestoreInstanceRequest; + + /** + * Creates a plain object from a RestoreInstanceRequest message. Also converts values to other types if specified. + * @param message RestoreInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.RestoreInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreInstanceRequest 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.filestore.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.filestore.v1beta1.IDeleteInstanceRequest): google.cloud.filestore.v1beta1.DeleteInstanceRequest; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IDeleteInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.DeleteInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListInstancesRequest. */ + interface IListInstancesRequest { + + /** ListInstancesRequest parent */ + parent?: (string|null); + + /** ListInstancesRequest pageSize */ + pageSize?: (number|null); + + /** ListInstancesRequest pageToken */ + pageToken?: (string|null); + + /** ListInstancesRequest orderBy */ + orderBy?: (string|null); + + /** ListInstancesRequest filter */ + filter?: (string|null); + } + + /** Represents a ListInstancesRequest. */ + class ListInstancesRequest implements IListInstancesRequest { + + /** + * Constructs a new ListInstancesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListInstancesRequest); + + /** ListInstancesRequest parent. */ + public parent: string; + + /** ListInstancesRequest pageSize. */ + public pageSize: number; + + /** ListInstancesRequest pageToken. */ + public pageToken: string; + + /** ListInstancesRequest orderBy. */ + public orderBy: string; + + /** ListInstancesRequest filter. */ + public filter: string; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListInstancesRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListInstancesRequest): google.cloud.filestore.v1beta1.ListInstancesRequest; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IListInstancesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.IListInstancesResponse); + + /** ListInstancesResponse instances. */ + public instances: google.cloud.filestore.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.filestore.v1beta1.IListInstancesResponse): google.cloud.filestore.v1beta1.ListInstancesResponse; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.filestore.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.filestore.v1beta1.IListInstancesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListInstancesResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListInstancesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup state */ + state?: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup capacityGb */ + capacityGb?: (number|Long|string|null); + + /** Backup storageBytes */ + storageBytes?: (number|Long|string|null); + + /** Backup sourceInstance */ + sourceInstance?: (string|null); + + /** Backup sourceFileShare */ + sourceFileShare?: (string|null); + + /** Backup sourceInstanceTier */ + sourceInstanceTier?: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier|null); + + /** Backup downloadBytes */ + downloadBytes?: (number|Long|string|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description: string; + + /** Backup state. */ + public state: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup capacityGb. */ + public capacityGb: (number|Long|string); + + /** Backup storageBytes. */ + public storageBytes: (number|Long|string); + + /** Backup sourceInstance. */ + public sourceInstance: string; + + /** Backup sourceFileShare. */ + public sourceFileShare: string; + + /** Backup sourceInstanceTier. */ + public sourceInstanceTier: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier); + + /** Backup downloadBytes. */ + public downloadBytes: (number|Long|string); + + /** Backup satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IBackup): google.cloud.filestore.v1beta1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not 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.filestore.v1beta1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload 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.filestore.v1beta1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + FINALIZING = 2, + READY = 3, + DELETING = 4 + } + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest): google.cloud.filestore.v1beta1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest): google.cloud.filestore.v1beta1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest): google.cloud.filestore.v1beta1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest): google.cloud.filestore.v1beta1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest): google.cloud.filestore.v1beta1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.filestore.v1beta1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.filestore.v1beta1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse): google.cloud.filestore.v1beta1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6 + } + + /** 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 }; + } + + /** 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 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 }; + } + + /** 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 DoubleValue. */ + interface IDoubleValue { + + /** DoubleValue value */ + value?: (number|null); + } + + /** Represents a DoubleValue. */ + class DoubleValue implements IDoubleValue { + + /** + * Constructs a new DoubleValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDoubleValue); + + /** DoubleValue value. */ + public value: number; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @param [properties] Properties to set + * @returns DoubleValue instance + */ + public static create(properties?: google.protobuf.IDoubleValue): google.protobuf.DoubleValue; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @param message DoubleValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDoubleValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DoubleValue; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DoubleValue; + + /** + * Verifies a DoubleValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DoubleValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DoubleValue; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @param message DoubleValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DoubleValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DoubleValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FloatValue. */ + interface IFloatValue { + + /** FloatValue value */ + value?: (number|null); + } + + /** Represents a FloatValue. */ + class FloatValue implements IFloatValue { + + /** + * Constructs a new FloatValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFloatValue); + + /** FloatValue value. */ + public value: number; + + /** + * Creates a new FloatValue instance using the specified properties. + * @param [properties] Properties to set + * @returns FloatValue instance + */ + public static create(properties?: google.protobuf.IFloatValue): google.protobuf.FloatValue; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @param message FloatValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFloatValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FloatValue; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FloatValue; + + /** + * Verifies a FloatValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FloatValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FloatValue; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @param message FloatValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FloatValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FloatValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int64Value. */ + interface IInt64Value { + + /** Int64Value value */ + value?: (number|Long|string|null); + } + + /** Represents an Int64Value. */ + class Int64Value implements IInt64Value { + + /** + * Constructs a new Int64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt64Value); + + /** Int64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new Int64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int64Value instance + */ + public static create(properties?: google.protobuf.IInt64Value): google.protobuf.Int64Value; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @param message Int64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int64Value; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int64Value; + + /** + * Verifies an Int64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int64Value; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @param message Int64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt64Value. */ + interface IUInt64Value { + + /** UInt64Value value */ + value?: (number|Long|string|null); + } + + /** Represents a UInt64Value. */ + class UInt64Value implements IUInt64Value { + + /** + * Constructs a new UInt64Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt64Value); + + /** UInt64Value value. */ + public value: (number|Long|string); + + /** + * Creates a new UInt64Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt64Value instance + */ + public static create(properties?: google.protobuf.IUInt64Value): google.protobuf.UInt64Value; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @param message UInt64Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt64Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt64Value; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt64Value; + + /** + * Verifies a UInt64Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt64Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt64Value; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @param message UInt64Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt64Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt64Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Int32Value. */ + interface IInt32Value { + + /** Int32Value value */ + value?: (number|null); + } + + /** Represents an Int32Value. */ + class Int32Value implements IInt32Value { + + /** + * Constructs a new Int32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IInt32Value); + + /** Int32Value value. */ + public value: number; + + /** + * Creates a new Int32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns Int32Value instance + */ + public static create(properties?: google.protobuf.IInt32Value): google.protobuf.Int32Value; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @param message Int32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.Int32Value; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.Int32Value; + + /** + * Verifies an Int32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Int32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.Int32Value; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @param message Int32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.Int32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Int32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a UInt32Value. */ + interface IUInt32Value { + + /** UInt32Value value */ + value?: (number|null); + } + + /** Represents a UInt32Value. */ + class UInt32Value implements IUInt32Value { + + /** + * Constructs a new UInt32Value. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUInt32Value); + + /** UInt32Value value. */ + public value: number; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @param [properties] Properties to set + * @returns UInt32Value instance + */ + public static create(properties?: google.protobuf.IUInt32Value): google.protobuf.UInt32Value; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @param message UInt32Value message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUInt32Value, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UInt32Value; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UInt32Value; + + /** + * Verifies a UInt32Value message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UInt32Value + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UInt32Value; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @param message UInt32Value + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UInt32Value, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UInt32Value to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BoolValue. */ + interface IBoolValue { + + /** BoolValue value */ + value?: (boolean|null); + } + + /** Represents a BoolValue. */ + class BoolValue implements IBoolValue { + + /** + * Constructs a new BoolValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBoolValue); + + /** BoolValue value. */ + public value: boolean; + + /** + * Creates a new BoolValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BoolValue instance + */ + public static create(properties?: google.protobuf.IBoolValue): google.protobuf.BoolValue; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @param message BoolValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBoolValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BoolValue; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BoolValue; + + /** + * Verifies a BoolValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BoolValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BoolValue; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @param message BoolValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BoolValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BoolValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StringValue. */ + interface IStringValue { + + /** StringValue value */ + value?: (string|null); + } + + /** Represents a StringValue. */ + class StringValue implements IStringValue { + + /** + * Constructs a new StringValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IStringValue); + + /** StringValue value. */ + public value: string; + + /** + * Creates a new StringValue instance using the specified properties. + * @param [properties] Properties to set + * @returns StringValue instance + */ + public static create(properties?: google.protobuf.IStringValue): google.protobuf.StringValue; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @param message StringValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IStringValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.StringValue; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.StringValue; + + /** + * Verifies a StringValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StringValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.StringValue; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @param message StringValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.StringValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StringValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BytesValue. */ + interface IBytesValue { + + /** BytesValue value */ + value?: (Uint8Array|string|null); + } + + /** Represents a BytesValue. */ + class BytesValue implements IBytesValue { + + /** + * Constructs a new BytesValue. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IBytesValue); + + /** BytesValue value. */ + public value: (Uint8Array|string); + + /** + * Creates a new BytesValue instance using the specified properties. + * @param [properties] Properties to set + * @returns BytesValue instance + */ + public static create(properties?: google.protobuf.IBytesValue): google.protobuf.BytesValue; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @param message BytesValue message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IBytesValue, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.BytesValue; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.BytesValue; + + /** + * Verifies a BytesValue message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BytesValue + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.BytesValue; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @param message BytesValue + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.BytesValue, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BytesValue to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** 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 }; + } + } +} diff --git a/packages/google-cloud-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js new file mode 100644 index 00000000000..fbd8fd3d693 --- /dev/null +++ b/packages/google-cloud-filestore/protos/protos.js @@ -0,0 +1,27055 @@ +// 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_filestore_protos || ($protobuf.roots._google_cloud_filestore_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.common = (function() { + + /** + * Namespace common. + * @memberof google.cloud + * @namespace + */ + var common = {}; + + common.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.common + * @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} [cancelRequested] OperationMetadata cancelRequested + * @property {string|null} [apiVersion] OperationMetadata apiVersion + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.common + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.common.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.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusDetail. + * @member {string} statusDetail + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusDetail = ""; + + /** + * OperationMetadata cancelRequested. + * @member {boolean} cancelRequested + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.cancelRequested = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.common.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.common.OperationMetadata + * @static + * @param {google.cloud.common.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.common.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.common.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.common.OperationMetadata + * @static + * @param {google.cloud.common.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.cancelRequested != null && Object.hasOwnProperty.call(message, "cancelRequested")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.cancelRequested); + 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.common.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.common.OperationMetadata + * @static + * @param {google.cloud.common.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.common.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.common.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.common.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.cancelRequested = 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.common.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.common.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.common.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.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + if (typeof message.cancelRequested !== "boolean") + return "cancelRequested: 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.common.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.common.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.common.OperationMetadata) + return object; + var message = new $root.google.cloud.common.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.common.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.common.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.cancelRequested != null) + message.cancelRequested = Boolean(object.cancelRequested); + 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.common.OperationMetadata + * @static + * @param {google.cloud.common.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.cancelRequested = 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.cancelRequested != null && message.hasOwnProperty("cancelRequested")) + object.cancelRequested = message.cancelRequested; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.common.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OperationMetadata; + })(); + + return common; + })(); + + cloud.filestore = (function() { + + /** + * Namespace filestore. + * @memberof google.cloud + * @namespace + */ + var filestore = {}; + + filestore.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.filestore + * @namespace + */ + var v1 = {}; + + v1.CloudFilestoreManager = (function() { + + /** + * Constructs a new CloudFilestoreManager service. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a CloudFilestoreManager + * @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 CloudFilestoreManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudFilestoreManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudFilestoreManager; + + /** + * Creates new CloudFilestoreManager service using the specified rpc implementation. + * @function create + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @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 {CloudFilestoreManager} RPC service. Useful where requests and/or responses are streamed. + */ + CloudFilestoreManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listInstances}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.filestore.v1.ListInstancesRequest, $root.google.cloud.filestore.v1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getInstance}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.filestore.v1.GetInstanceRequest, $root.google.cloud.filestore.v1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createInstance}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.filestore.v1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateInstance}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.filestore.v1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#restoreInstance}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef RestoreInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreInstance. + * @function restoreInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest} request RestoreInstanceRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.restoreInstance = function restoreInstance(request, callback) { + return this.rpcCall(restoreInstance, $root.google.cloud.filestore.v1.RestoreInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreInstance" }); + + /** + * Calls RestoreInstance. + * @function restoreInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest} request RestoreInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteInstance}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.filestore.v1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listBackups}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.filestore.v1.ListBackupsRequest, $root.google.cloud.filestore.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getBackup}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.filestore.v1.GetBackupRequest, $root.google.cloud.filestore.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createBackup}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.filestore.v1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteBackup}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.filestore.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateBackup}. + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.filestore.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.filestore.v1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudFilestoreManager; + })(); + + v1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.filestore.v1 + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {Array.|null} [modes] NetworkConfig modes + * @property {string|null} [reservedIpRange] NetworkConfig reservedIpRange + * @property {Array.|null} [ipAddresses] NetworkConfig ipAddresses + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.filestore.v1.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + this.modes = []; + this.ipAddresses = []; + if (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.filestore.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig modes. + * @member {Array.} modes + * @memberof google.cloud.filestore.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.modes = $util.emptyArray; + + /** + * NetworkConfig reservedIpRange. + * @member {string} reservedIpRange + * @memberof google.cloud.filestore.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.reservedIpRange = ""; + + /** + * NetworkConfig ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.filestore.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.ipAddresses = $util.emptyArray; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.NetworkConfig + * @static + * @param {google.cloud.filestore.v1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.filestore.v1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.modes != null && message.modes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.modes.length; ++i) + writer.int32(message.modes[i]); + writer.ldelim(); + } + if (message.reservedIpRange != null && Object.hasOwnProperty.call(message, "reservedIpRange")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.reservedIpRange); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.ipAddresses[i]); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.network = reader.string(); + break; + case 3: + if (!(message.modes && message.modes.length)) + message.modes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modes.push(reader.int32()); + } else + message.modes.push(reader.int32()); + break; + case 4: + message.reservedIpRange = reader.string(); + break; + case 5: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(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.filestore.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.modes != null && message.hasOwnProperty("modes")) { + if (!Array.isArray(message.modes)) + return "modes: array expected"; + for (var i = 0; i < message.modes.length; ++i) + switch (message.modes[i]) { + default: + return "modes: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + if (!$util.isString(message.reservedIpRange)) + return "reservedIpRange: string expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: 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.filestore.v1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.NetworkConfig) + return object; + var message = new $root.google.cloud.filestore.v1.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.modes) { + if (!Array.isArray(object.modes)) + throw TypeError(".google.cloud.filestore.v1.NetworkConfig.modes: array expected"); + message.modes = []; + for (var i = 0; i < object.modes.length; ++i) + switch (object.modes[i]) { + default: + case "ADDRESS_MODE_UNSPECIFIED": + case 0: + message.modes[i] = 0; + break; + case "MODE_IPV4": + case 1: + message.modes[i] = 1; + break; + } + } + if (object.reservedIpRange != null) + message.reservedIpRange = String(object.reservedIpRange); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.filestore.v1.NetworkConfig.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.arrays || options.defaults) { + object.modes = []; + object.ipAddresses = []; + } + if (options.defaults) { + object.network = ""; + object.reservedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.modes && message.modes.length) { + object.modes = []; + for (var j = 0; j < message.modes.length; ++j) + object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; + } + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + object.reservedIpRange = message.reservedIpRange; + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AddressMode enum. + * @name google.cloud.filestore.v1.NetworkConfig.AddressMode + * @enum {number} + * @property {number} ADDRESS_MODE_UNSPECIFIED=0 ADDRESS_MODE_UNSPECIFIED value + * @property {number} MODE_IPV4=1 MODE_IPV4 value + */ + NetworkConfig.AddressMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ADDRESS_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODE_IPV4"] = 1; + return values; + })(); + + return NetworkConfig; + })(); + + v1.FileShareConfig = (function() { + + /** + * Properties of a FileShareConfig. + * @memberof google.cloud.filestore.v1 + * @interface IFileShareConfig + * @property {string|null} [name] FileShareConfig name + * @property {number|Long|null} [capacityGb] FileShareConfig capacityGb + * @property {string|null} [sourceBackup] FileShareConfig sourceBackup + * @property {Array.|null} [nfsExportOptions] FileShareConfig nfsExportOptions + */ + + /** + * Constructs a new FileShareConfig. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a FileShareConfig. + * @implements IFileShareConfig + * @constructor + * @param {google.cloud.filestore.v1.IFileShareConfig=} [properties] Properties to set + */ + function FileShareConfig(properties) { + this.nfsExportOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileShareConfig name. + * @member {string} name + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.name = ""; + + /** + * FileShareConfig capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FileShareConfig sourceBackup. + * @member {string|null|undefined} sourceBackup + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.sourceBackup = null; + + /** + * FileShareConfig nfsExportOptions. + * @member {Array.} nfsExportOptions + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.nfsExportOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileShareConfig source. + * @member {"sourceBackup"|undefined} source + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + */ + Object.defineProperty(FileShareConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceBackup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileShareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1.IFileShareConfig=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.FileShareConfig} FileShareConfig instance + */ + FileShareConfig.create = function create(properties) { + return new FileShareConfig(properties); + }; + + /** + * Encodes the specified FileShareConfig message. Does not implicitly {@link google.cloud.filestore.v1.FileShareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1.IFileShareConfig} message FileShareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileShareConfig.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.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.capacityGb); + if (message.nfsExportOptions != null && message.nfsExportOptions.length) + for (var i = 0; i < message.nfsExportOptions.length; ++i) + $root.google.cloud.filestore.v1.NfsExportOptions.encode(message.nfsExportOptions[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified FileShareConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.FileShareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1.IFileShareConfig} message FileShareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileShareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.FileShareConfig} FileShareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileShareConfig.decode = function 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.filestore.v1.FileShareConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.capacityGb = reader.int64(); + break; + case 8: + message.sourceBackup = reader.string(); + break; + case 7: + if (!(message.nfsExportOptions && message.nfsExportOptions.length)) + message.nfsExportOptions = []; + message.nfsExportOptions.push($root.google.cloud.filestore.v1.NfsExportOptions.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.FileShareConfig} FileShareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileShareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileShareConfig message. + * @function verify + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileShareConfig.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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + properties.source = 1; + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + } + if (message.nfsExportOptions != null && message.hasOwnProperty("nfsExportOptions")) { + if (!Array.isArray(message.nfsExportOptions)) + return "nfsExportOptions: array expected"; + for (var i = 0; i < message.nfsExportOptions.length; ++i) { + var error = $root.google.cloud.filestore.v1.NfsExportOptions.verify(message.nfsExportOptions[i]); + if (error) + return "nfsExportOptions." + error; + } + } + return null; + }; + + /** + * Creates a FileShareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.FileShareConfig} FileShareConfig + */ + FileShareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.FileShareConfig) + return object; + var message = new $root.google.cloud.filestore.v1.FileShareConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.nfsExportOptions) { + if (!Array.isArray(object.nfsExportOptions)) + throw TypeError(".google.cloud.filestore.v1.FileShareConfig.nfsExportOptions: array expected"); + message.nfsExportOptions = []; + for (var i = 0; i < object.nfsExportOptions.length; ++i) { + if (typeof object.nfsExportOptions[i] !== "object") + throw TypeError(".google.cloud.filestore.v1.FileShareConfig.nfsExportOptions: object expected"); + message.nfsExportOptions[i] = $root.google.cloud.filestore.v1.NfsExportOptions.fromObject(object.nfsExportOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileShareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1.FileShareConfig} message FileShareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileShareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nfsExportOptions = []; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.nfsExportOptions && message.nfsExportOptions.length) { + object.nfsExportOptions = []; + for (var j = 0; j < message.nfsExportOptions.length; ++j) + object.nfsExportOptions[j] = $root.google.cloud.filestore.v1.NfsExportOptions.toObject(message.nfsExportOptions[j], options); + } + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + object.sourceBackup = message.sourceBackup; + if (options.oneofs) + object.source = "sourceBackup"; + } + return object; + }; + + /** + * Converts this FileShareConfig to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.FileShareConfig + * @instance + * @returns {Object.} JSON object + */ + FileShareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileShareConfig; + })(); + + v1.NfsExportOptions = (function() { + + /** + * Properties of a NfsExportOptions. + * @memberof google.cloud.filestore.v1 + * @interface INfsExportOptions + * @property {Array.|null} [ipRanges] NfsExportOptions ipRanges + * @property {google.cloud.filestore.v1.NfsExportOptions.AccessMode|null} [accessMode] NfsExportOptions accessMode + * @property {google.cloud.filestore.v1.NfsExportOptions.SquashMode|null} [squashMode] NfsExportOptions squashMode + * @property {number|Long|null} [anonUid] NfsExportOptions anonUid + * @property {number|Long|null} [anonGid] NfsExportOptions anonGid + */ + + /** + * Constructs a new NfsExportOptions. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a NfsExportOptions. + * @implements INfsExportOptions + * @constructor + * @param {google.cloud.filestore.v1.INfsExportOptions=} [properties] Properties to set + */ + function NfsExportOptions(properties) { + this.ipRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NfsExportOptions ipRanges. + * @member {Array.} ipRanges + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.ipRanges = $util.emptyArray; + + /** + * NfsExportOptions accessMode. + * @member {google.cloud.filestore.v1.NfsExportOptions.AccessMode} accessMode + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.accessMode = 0; + + /** + * NfsExportOptions squashMode. + * @member {google.cloud.filestore.v1.NfsExportOptions.SquashMode} squashMode + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.squashMode = 0; + + /** + * NfsExportOptions anonUid. + * @member {number|Long} anonUid + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.anonUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * NfsExportOptions anonGid. + * @member {number|Long} anonGid + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.anonGid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NfsExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1.INfsExportOptions=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.NfsExportOptions} NfsExportOptions instance + */ + NfsExportOptions.create = function create(properties) { + return new NfsExportOptions(properties); + }; + + /** + * Encodes the specified NfsExportOptions message. Does not implicitly {@link google.cloud.filestore.v1.NfsExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1.INfsExportOptions} message NfsExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NfsExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipRanges != null && message.ipRanges.length) + for (var i = 0; i < message.ipRanges.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipRanges[i]); + if (message.accessMode != null && Object.hasOwnProperty.call(message, "accessMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.accessMode); + if (message.squashMode != null && Object.hasOwnProperty.call(message, "squashMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.squashMode); + if (message.anonUid != null && Object.hasOwnProperty.call(message, "anonUid")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.anonUid); + if (message.anonGid != null && Object.hasOwnProperty.call(message, "anonGid")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.anonGid); + return writer; + }; + + /** + * Encodes the specified NfsExportOptions message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.NfsExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1.INfsExportOptions} message NfsExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NfsExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.NfsExportOptions} NfsExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NfsExportOptions.decode = function 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.filestore.v1.NfsExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipRanges && message.ipRanges.length)) + message.ipRanges = []; + message.ipRanges.push(reader.string()); + break; + case 2: + message.accessMode = reader.int32(); + break; + case 3: + message.squashMode = reader.int32(); + break; + case 4: + message.anonUid = reader.int64(); + break; + case 5: + message.anonGid = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.NfsExportOptions} NfsExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NfsExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NfsExportOptions message. + * @function verify + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NfsExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipRanges != null && message.hasOwnProperty("ipRanges")) { + if (!Array.isArray(message.ipRanges)) + return "ipRanges: array expected"; + for (var i = 0; i < message.ipRanges.length; ++i) + if (!$util.isString(message.ipRanges[i])) + return "ipRanges: string[] expected"; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) + switch (message.accessMode) { + default: + return "accessMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.squashMode != null && message.hasOwnProperty("squashMode")) + switch (message.squashMode) { + default: + return "squashMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.anonUid != null && message.hasOwnProperty("anonUid")) + if (!$util.isInteger(message.anonUid) && !(message.anonUid && $util.isInteger(message.anonUid.low) && $util.isInteger(message.anonUid.high))) + return "anonUid: integer|Long expected"; + if (message.anonGid != null && message.hasOwnProperty("anonGid")) + if (!$util.isInteger(message.anonGid) && !(message.anonGid && $util.isInteger(message.anonGid.low) && $util.isInteger(message.anonGid.high))) + return "anonGid: integer|Long expected"; + return null; + }; + + /** + * Creates a NfsExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.NfsExportOptions} NfsExportOptions + */ + NfsExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.NfsExportOptions) + return object; + var message = new $root.google.cloud.filestore.v1.NfsExportOptions(); + if (object.ipRanges) { + if (!Array.isArray(object.ipRanges)) + throw TypeError(".google.cloud.filestore.v1.NfsExportOptions.ipRanges: array expected"); + message.ipRanges = []; + for (var i = 0; i < object.ipRanges.length; ++i) + message.ipRanges[i] = String(object.ipRanges[i]); + } + switch (object.accessMode) { + case "ACCESS_MODE_UNSPECIFIED": + case 0: + message.accessMode = 0; + break; + case "READ_ONLY": + case 1: + message.accessMode = 1; + break; + case "READ_WRITE": + case 2: + message.accessMode = 2; + break; + } + switch (object.squashMode) { + case "SQUASH_MODE_UNSPECIFIED": + case 0: + message.squashMode = 0; + break; + case "NO_ROOT_SQUASH": + case 1: + message.squashMode = 1; + break; + case "ROOT_SQUASH": + case 2: + message.squashMode = 2; + break; + } + if (object.anonUid != null) + if ($util.Long) + (message.anonUid = $util.Long.fromValue(object.anonUid)).unsigned = false; + else if (typeof object.anonUid === "string") + message.anonUid = parseInt(object.anonUid, 10); + else if (typeof object.anonUid === "number") + message.anonUid = object.anonUid; + else if (typeof object.anonUid === "object") + message.anonUid = new $util.LongBits(object.anonUid.low >>> 0, object.anonUid.high >>> 0).toNumber(); + if (object.anonGid != null) + if ($util.Long) + (message.anonGid = $util.Long.fromValue(object.anonGid)).unsigned = false; + else if (typeof object.anonGid === "string") + message.anonGid = parseInt(object.anonGid, 10); + else if (typeof object.anonGid === "number") + message.anonGid = object.anonGid; + else if (typeof object.anonGid === "object") + message.anonGid = new $util.LongBits(object.anonGid.low >>> 0, object.anonGid.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a NfsExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1.NfsExportOptions} message NfsExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NfsExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipRanges = []; + if (options.defaults) { + object.accessMode = options.enums === String ? "ACCESS_MODE_UNSPECIFIED" : 0; + object.squashMode = options.enums === String ? "SQUASH_MODE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.anonUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.anonUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.anonGid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.anonGid = options.longs === String ? "0" : 0; + } + if (message.ipRanges && message.ipRanges.length) { + object.ipRanges = []; + for (var j = 0; j < message.ipRanges.length; ++j) + object.ipRanges[j] = message.ipRanges[j]; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) + object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; + if (message.squashMode != null && message.hasOwnProperty("squashMode")) + object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; + if (message.anonUid != null && message.hasOwnProperty("anonUid")) + if (typeof message.anonUid === "number") + object.anonUid = options.longs === String ? String(message.anonUid) : message.anonUid; + else + object.anonUid = options.longs === String ? $util.Long.prototype.toString.call(message.anonUid) : options.longs === Number ? new $util.LongBits(message.anonUid.low >>> 0, message.anonUid.high >>> 0).toNumber() : message.anonUid; + if (message.anonGid != null && message.hasOwnProperty("anonGid")) + if (typeof message.anonGid === "number") + object.anonGid = options.longs === String ? String(message.anonGid) : message.anonGid; + else + object.anonGid = options.longs === String ? $util.Long.prototype.toString.call(message.anonGid) : options.longs === Number ? new $util.LongBits(message.anonGid.low >>> 0, message.anonGid.high >>> 0).toNumber() : message.anonGid; + return object; + }; + + /** + * Converts this NfsExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @instance + * @returns {Object.} JSON object + */ + NfsExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AccessMode enum. + * @name google.cloud.filestore.v1.NfsExportOptions.AccessMode + * @enum {number} + * @property {number} ACCESS_MODE_UNSPECIFIED=0 ACCESS_MODE_UNSPECIFIED value + * @property {number} READ_ONLY=1 READ_ONLY value + * @property {number} READ_WRITE=2 READ_WRITE value + */ + NfsExportOptions.AccessMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_ONLY"] = 1; + values[valuesById[2] = "READ_WRITE"] = 2; + return values; + })(); + + /** + * SquashMode enum. + * @name google.cloud.filestore.v1.NfsExportOptions.SquashMode + * @enum {number} + * @property {number} SQUASH_MODE_UNSPECIFIED=0 SQUASH_MODE_UNSPECIFIED value + * @property {number} NO_ROOT_SQUASH=1 NO_ROOT_SQUASH value + * @property {number} ROOT_SQUASH=2 ROOT_SQUASH value + */ + NfsExportOptions.SquashMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQUASH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_ROOT_SQUASH"] = 1; + values[valuesById[2] = "ROOT_SQUASH"] = 2; + return values; + })(); + + return NfsExportOptions; + })(); + + v1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.filestore.v1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {google.cloud.filestore.v1.Instance.State|null} [state] Instance state + * @property {string|null} [statusMessage] Instance statusMessage + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.cloud.filestore.v1.Instance.Tier|null} [tier] Instance tier + * @property {Object.|null} [labels] Instance labels + * @property {Array.|null} [fileShares] Instance fileShares + * @property {Array.|null} [networks] Instance networks + * @property {string|null} [etag] Instance etag + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Instance satisfiesPzs + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.filestore.v1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.fileShares = []; + this.networks = []; + if (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.filestore.v1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance state. + * @member {google.cloud.filestore.v1.Instance.State} state + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.statusMessage = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance tier. + * @member {google.cloud.filestore.v1.Instance.Tier} tier + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.tier = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance fileShares. + * @member {Array.} fileShares + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.fileShares = $util.emptyArray; + + /** + * Instance networks. + * @member {Array.} networks + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.networks = $util.emptyArray; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.filestore.v1.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.Instance + * @static + * @param {google.cloud.filestore.v1.IInstance=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.filestore.v1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.Instance + * @static + * @param {google.cloud.filestore.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.statusMessage); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.tier); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fileShares != null && message.fileShares.length) + for (var i = 0; i < message.fileShares.length; ++i) + $root.google.cloud.filestore.v1.FileShareConfig.encode(message.fileShares[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.networks != null && message.networks.length) + for (var i = 0; i < message.networks.length; ++i) + $root.google.cloud.filestore.v1.NetworkConfig.encode(message.networks[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.Instance + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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 5: + message.state = reader.int32(); + break; + case 6: + message.statusMessage = reader.string(); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.tier = reader.int32(); + break; + case 9: + 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 10: + if (!(message.fileShares && message.fileShares.length)) + message.fileShares = []; + message.fileShares.push($root.google.cloud.filestore.v1.FileShareConfig.decode(reader, reader.uint32())); + break; + case 11: + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.filestore.v1.NetworkConfig.decode(reader, reader.uint32())); + break; + case 12: + message.etag = reader.string(); + break; + case 13: + message.satisfiesPzs = $root.google.protobuf.BoolValue.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.filestore.v1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.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 6: + case 7: + break; + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: 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.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.fileShares != null && message.hasOwnProperty("fileShares")) { + if (!Array.isArray(message.fileShares)) + return "fileShares: array expected"; + for (var i = 0; i < message.fileShares.length; ++i) { + var error = $root.google.cloud.filestore.v1.FileShareConfig.verify(message.fileShares[i]); + if (error) + return "fileShares." + error; + } + } + if (message.networks != null && message.hasOwnProperty("networks")) { + if (!Array.isArray(message.networks)) + return "networks: array expected"; + for (var i = 0; i < message.networks.length; ++i) { + var error = $root.google.cloud.filestore.v1.NetworkConfig.verify(message.networks[i]); + if (error) + return "networks." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.Instance) + return object; + var message = new $root.google.cloud.filestore.v1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "REPAIRING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "RESTORING": + case 7: + message.state = 7; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.tier) { + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "STANDARD": + case 1: + message.tier = 1; + break; + case "PREMIUM": + case 2: + message.tier = 2; + break; + case "BASIC_HDD": + case 3: + message.tier = 3; + break; + case "BASIC_SSD": + case 4: + message.tier = 4; + break; + case "HIGH_SCALE_SSD": + case 5: + message.tier = 5; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.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.fileShares) { + if (!Array.isArray(object.fileShares)) + throw TypeError(".google.cloud.filestore.v1.Instance.fileShares: array expected"); + message.fileShares = []; + for (var i = 0; i < object.fileShares.length; ++i) { + if (typeof object.fileShares[i] !== "object") + throw TypeError(".google.cloud.filestore.v1.Instance.fileShares: object expected"); + message.fileShares[i] = $root.google.cloud.filestore.v1.FileShareConfig.fromObject(object.fileShares[i]); + } + } + if (object.networks) { + if (!Array.isArray(object.networks)) + throw TypeError(".google.cloud.filestore.v1.Instance.networks: array expected"); + message.networks = []; + for (var i = 0; i < object.networks.length; ++i) { + if (typeof object.networks[i] !== "object") + throw TypeError(".google.cloud.filestore.v1.Instance.networks: object expected"); + message.networks[i] = $root.google.cloud.filestore.v1.NetworkConfig.fromObject(object.networks[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.filestore.v1.Instance.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.Instance + * @static + * @param {google.cloud.filestore.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.fileShares = []; + object.networks = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.statusMessage = ""; + object.createTime = null; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.etag = ""; + object.satisfiesPzs = 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1.Instance.State[message.state] : message.state; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.tier] : message.tier; + 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.fileShares && message.fileShares.length) { + object.fileShares = []; + for (var j = 0; j < message.fileShares.length; ++j) + object.fileShares[j] = $root.google.cloud.filestore.v1.FileShareConfig.toObject(message.fileShares[j], options); + } + if (message.networks && message.networks.length) { + object.networks = []; + for (var j = 0; j < message.networks.length; ++j) + object.networks[j] = $root.google.cloud.filestore.v1.NetworkConfig.toObject(message.networks[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.filestore.v1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} REPAIRING=3 REPAIRING value + * @property {number} DELETING=4 DELETING value + * @property {number} ERROR=6 ERROR value + * @property {number} RESTORING=7 RESTORING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "REPAIRING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "RESTORING"] = 7; + return values; + })(); + + /** + * Tier enum. + * @name google.cloud.filestore.v1.Instance.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} PREMIUM=2 PREMIUM value + * @property {number} BASIC_HDD=3 BASIC_HDD value + * @property {number} BASIC_SSD=4 BASIC_SSD value + * @property {number} HIGH_SCALE_SSD=5 HIGH_SCALE_SSD value + */ + Instance.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "PREMIUM"] = 2; + values[valuesById[3] = "BASIC_HDD"] = 3; + values[valuesById[4] = "BASIC_SSD"] = 4; + values[valuesById[5] = "HIGH_SCALE_SSD"] = 5; + return values; + })(); + + return Instance; + })(); + + v1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.filestore.v1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.filestore.v1.IInstance|null|undefined} instance + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.v1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.filestore.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.filestore.v1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.v1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.filestore.v1.IInstance|null} [instance] UpdateInstanceRequest instance + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.filestore.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 updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.filestore.v1.IInstance|null|undefined} instance + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.filestore.v1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 2: + message.instance = $root.google.cloud.filestore.v1.Instance.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.filestore.v1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.filestore.v1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.v1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.filestore.v1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.filestore.v1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.updateMask = null; + object.instance = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.filestore.v1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1.RestoreInstanceRequest = (function() { + + /** + * Properties of a RestoreInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @interface IRestoreInstanceRequest + * @property {string|null} [name] RestoreInstanceRequest name + * @property {string|null} [fileShare] RestoreInstanceRequest fileShare + * @property {string|null} [sourceBackup] RestoreInstanceRequest sourceBackup + */ + + /** + * Constructs a new RestoreInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a RestoreInstanceRequest. + * @implements IRestoreInstanceRequest + * @constructor + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest=} [properties] Properties to set + */ + function RestoreInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInstanceRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.name = ""; + + /** + * RestoreInstanceRequest fileShare. + * @member {string} fileShare + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.fileShare = ""; + + /** + * RestoreInstanceRequest sourceBackup. + * @member {string|null|undefined} sourceBackup + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.sourceBackup = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInstanceRequest source. + * @member {"sourceBackup"|undefined} source + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @instance + */ + Object.defineProperty(RestoreInstanceRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceBackup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.RestoreInstanceRequest} RestoreInstanceRequest instance + */ + RestoreInstanceRequest.create = function create(properties) { + return new RestoreInstanceRequest(properties); + }; + + /** + * Encodes the specified RestoreInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.RestoreInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest} message RestoreInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInstanceRequest.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.fileShare != null && Object.hasOwnProperty.call(message, "fileShare")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileShare); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified RestoreInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.RestoreInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IRestoreInstanceRequest} message RestoreInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.RestoreInstanceRequest} RestoreInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInstanceRequest.decode = function 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.filestore.v1.RestoreInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.fileShare = reader.string(); + break; + case 3: + message.sourceBackup = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.RestoreInstanceRequest} RestoreInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInstanceRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInstanceRequest.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.fileShare != null && message.hasOwnProperty("fileShare")) + if (!$util.isString(message.fileShare)) + return "fileShare: string expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + properties.source = 1; + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + } + return null; + }; + + /** + * Creates a RestoreInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.RestoreInstanceRequest} RestoreInstanceRequest + */ + RestoreInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.RestoreInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.v1.RestoreInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fileShare != null) + message.fileShare = String(object.fileShare); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + return message; + }; + + /** + * Creates a plain object from a RestoreInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1.RestoreInstanceRequest} message RestoreInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fileShare = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fileShare != null && message.hasOwnProperty("fileShare")) + object.fileShare = message.fileShare; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + object.sourceBackup = message.sourceBackup; + if (options.oneofs) + object.source = "sourceBackup"; + } + return object; + }; + + /** + * Converts this RestoreInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestoreInstanceRequest; + })(); + + v1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.v1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.v1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.filestore.v1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @property {string|null} [filter] ListInstancesRequest filter + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.v1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.filestore.v1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.orderBy = reader.string(); + break; + case 5: + message.filter = 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.filestore.v1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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.filestore.v1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.filestore.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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.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.filestore.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.filestore.v1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.filestore.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.filestore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.v1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.filestore.v1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.filestore.v1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.filestore.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.filestore.v1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.filestore.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.filestore.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.filestore.v1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.filestore.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.cloud.filestore.v1.Backup.State|null} [state] Backup state + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {Object.|null} [labels] Backup labels + * @property {number|Long|null} [capacityGb] Backup capacityGb + * @property {number|Long|null} [storageBytes] Backup storageBytes + * @property {string|null} [sourceInstance] Backup sourceInstance + * @property {string|null} [sourceFileShare] Backup sourceFileShare + * @property {google.cloud.filestore.v1.Instance.Tier|null} [sourceInstanceTier] Backup sourceInstanceTier + * @property {number|Long|null} [downloadBytes] Backup downloadBytes + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Backup satisfiesPzs + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.filestore.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup state. + * @member {google.cloud.filestore.v1.Backup.State} state + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup storageBytes. + * @member {number|Long} storageBytes + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.storageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup sourceInstance. + * @member {string} sourceInstance + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.sourceInstance = ""; + + /** + * Backup sourceFileShare. + * @member {string} sourceFileShare + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.sourceFileShare = ""; + + /** + * Backup sourceInstanceTier. + * @member {google.cloud.filestore.v1.Instance.Tier} sourceInstanceTier + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.sourceInstanceTier = 0; + + /** + * Backup downloadBytes. + * @member {number|Long} downloadBytes + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.downloadBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.filestore.v1.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = null; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {google.cloud.filestore.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {google.cloud.filestore.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacityGb); + if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.storageBytes); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceInstance); + if (message.sourceFileShare != null && Object.hasOwnProperty.call(message, "sourceFileShare")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceFileShare); + if (message.sourceInstanceTier != null && Object.hasOwnProperty.call(message, "sourceInstanceTier")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sourceInstanceTier); + if (message.downloadBytes != null && Object.hasOwnProperty.call(message, "downloadBytes")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.downloadBytes); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {google.cloud.filestore.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function 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.filestore.v1.Backup(), 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.state = reader.int32(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 6: + message.capacityGb = reader.int64(); + break; + case 7: + message.storageBytes = reader.int64(); + break; + case 8: + message.sourceInstance = reader.string(); + break; + case 9: + message.sourceFileShare = reader.string(); + break; + case 10: + message.sourceInstanceTier = reader.int32(); + break; + case 11: + message.downloadBytes = reader.int64(); + break; + case 12: + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) + return "storageBytes: integer|Long expected"; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + if (!$util.isString(message.sourceFileShare)) + return "sourceFileShare: string expected"; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + switch (message.sourceInstanceTier) { + default: + return "sourceInstanceTier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (!$util.isInteger(message.downloadBytes) && !(message.downloadBytes && $util.isInteger(message.downloadBytes.low) && $util.isInteger(message.downloadBytes.high))) + return "downloadBytes: integer|Long expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.Backup) + return object; + var message = new $root.google.cloud.filestore.v1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "FINALIZING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.v1.Backup.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.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.storageBytes != null) + if ($util.Long) + (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; + else if (typeof object.storageBytes === "string") + message.storageBytes = parseInt(object.storageBytes, 10); + else if (typeof object.storageBytes === "number") + message.storageBytes = object.storageBytes; + else if (typeof object.storageBytes === "object") + message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.sourceFileShare != null) + message.sourceFileShare = String(object.sourceFileShare); + switch (object.sourceInstanceTier) { + case "TIER_UNSPECIFIED": + case 0: + message.sourceInstanceTier = 0; + break; + case "STANDARD": + case 1: + message.sourceInstanceTier = 1; + break; + case "PREMIUM": + case 2: + message.sourceInstanceTier = 2; + break; + case "BASIC_HDD": + case 3: + message.sourceInstanceTier = 3; + break; + case "BASIC_SSD": + case 4: + message.sourceInstanceTier = 4; + break; + case "HIGH_SCALE_SSD": + case 5: + message.sourceInstanceTier = 5; + break; + } + if (object.downloadBytes != null) + if ($util.Long) + (message.downloadBytes = $util.Long.fromValue(object.downloadBytes)).unsigned = false; + else if (typeof object.downloadBytes === "string") + message.downloadBytes = parseInt(object.downloadBytes, 10); + else if (typeof object.downloadBytes === "number") + message.downloadBytes = object.downloadBytes; + else if (typeof object.downloadBytes === "object") + message.downloadBytes = new $util.LongBits(object.downloadBytes.low >>> 0, object.downloadBytes.high >>> 0).toNumber(); + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.filestore.v1.Backup.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {google.cloud.filestore.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageBytes = options.longs === String ? "0" : 0; + object.sourceInstance = ""; + object.sourceFileShare = ""; + object.sourceInstanceTier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.downloadBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.downloadBytes = options.longs === String ? "0" : 0; + object.satisfiesPzs = 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1.Backup.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (typeof message.storageBytes === "number") + object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; + else + object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + object.sourceInstance = message.sourceInstance; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + object.sourceFileShare = message.sourceFileShare; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (typeof message.downloadBytes === "number") + object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; + else + object.downloadBytes = options.longs === String ? $util.Long.prototype.toString.call(message.downloadBytes) : options.longs === Number ? new $util.LongBits(message.downloadBytes.low >>> 0, message.downloadBytes.high >>> 0).toNumber() : message.downloadBytes; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.filestore.v1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} FINALIZING=2 FINALIZING value + * @property {number} READY=3 READY value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "FINALIZING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Backup; + })(); + + v1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.filestore.v1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {google.cloud.filestore.v1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [backupId] CreateBackupRequest backupId + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.filestore.v1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.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.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function 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.filestore.v1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.backup = $root.google.cloud.filestore.v1.Backup.decode(reader, reader.uint32()); + break; + case 3: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.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.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.CreateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1.Backup.fromObject(object.backup); + } + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backup = null; + object.backupId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1.Backup.toObject(message.backup, options); + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.filestore.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.filestore.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.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 DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function 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.filestore.v1.DeleteBackupRequest(); + 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 DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.filestore.v1 + * @interface IUpdateBackupRequest + * @property {google.cloud.filestore.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.filestore.v1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1.Backup.encode(message.backup, 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 UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function 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.filestore.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backup = $root.google.cloud.filestore.v1.Backup.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 UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1.Backup.verify(message.backup); + if (error) + return "backup." + 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBackupRequest; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.filestore.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.filestore.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.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 GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function 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.filestore.v1.GetBackupRequest(); + 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 GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.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 GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.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 GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBackupRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.filestore.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {string|null} [filter] ListBackupsRequest filter + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.filestore.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function 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.filestore.v1.ListBackupsRequest(); + 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.orderBy = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.filestore.v1.ListBackupsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.filestore.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.filestore.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.filestore.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + 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]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.filestore.v1.Backup.encode(message.backups[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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function 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.filestore.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.filestore.v1.Backup.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 ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.filestore.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + 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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.filestore.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.filestore.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.filestore.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.filestore.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.filestore.v1.ListBackupsResponse.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 ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.filestore.v1.Backup.toObject(message.backups[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 ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackupsResponse; + })(); + + return v1; + })(); + + filestore.v1beta1 = (function() { + + /** + * Namespace v1beta1. + * @memberof google.cloud.filestore + * @namespace + */ + var v1beta1 = {}; + + v1beta1.CloudFilestoreManager = (function() { + + /** + * Constructs a new CloudFilestoreManager service. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a CloudFilestoreManager + * @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 CloudFilestoreManager(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (CloudFilestoreManager.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = CloudFilestoreManager; + + /** + * Creates new CloudFilestoreManager service using the specified rpc implementation. + * @function create + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @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 {CloudFilestoreManager} RPC service. Useful where requests and/or responses are streamed. + */ + CloudFilestoreManager.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listInstances}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef ListInstancesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.ListInstancesResponse} [response] ListInstancesResponse + */ + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstancesCallback} callback Node-style callback called with the error, if any, and ListInstancesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listInstances = function listInstances(request, callback) { + return this.rpcCall(listInstances, $root.google.cloud.filestore.v1beta1.ListInstancesRequest, $root.google.cloud.filestore.v1beta1.ListInstancesResponse, request, callback); + }, "name", { value: "ListInstances" }); + + /** + * Calls ListInstances. + * @function listInstances + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListInstancesRequest} request ListInstancesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef GetInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.Instance} [response] Instance + */ + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstanceCallback} callback Node-style callback called with the error, if any, and Instance + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getInstance = function getInstance(request, callback) { + return this.rpcCall(getInstance, $root.google.cloud.filestore.v1beta1.GetInstanceRequest, $root.google.cloud.filestore.v1beta1.Instance, request, callback); + }, "name", { value: "GetInstance" }); + + /** + * Calls GetInstance. + * @function getInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetInstanceRequest} request GetInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef CreateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createInstance = function createInstance(request, callback) { + return this.rpcCall(createInstance, $root.google.cloud.filestore.v1beta1.CreateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateInstance" }); + + /** + * Calls CreateInstance. + * @function createInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateInstanceRequest} request CreateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef UpdateInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateInstance = function updateInstance(request, callback) { + return this.rpcCall(updateInstance, $root.google.cloud.filestore.v1beta1.UpdateInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateInstance" }); + + /** + * Calls UpdateInstance. + * @function updateInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateInstanceRequest} request UpdateInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#restoreInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef RestoreInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreInstance. + * @function restoreInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest} request RestoreInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.restoreInstance = function restoreInstance(request, callback) { + return this.rpcCall(restoreInstance, $root.google.cloud.filestore.v1beta1.RestoreInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreInstance" }); + + /** + * Calls RestoreInstance. + * @function restoreInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest} request RestoreInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef DeleteInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteInstance = function deleteInstance(request, callback) { + return this.rpcCall(deleteInstance, $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteInstance" }); + + /** + * Calls DeleteInstance. + * @function deleteInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest} request DeleteInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listBackups}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.filestore.v1beta1.ListBackupsRequest, $root.google.cloud.filestore.v1beta1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getBackup}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.filestore.v1beta1.GetBackupRequest, $root.google.cloud.filestore.v1beta1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createBackup}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef CreateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createBackup = function createBackup(request, callback) { + return this.rpcCall(createBackup, $root.google.cloud.filestore.v1beta1.CreateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackup" }); + + /** + * Calls CreateBackup. + * @function createBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} request CreateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteBackup}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.filestore.v1beta1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateBackup}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.filestore.v1beta1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return CloudFilestoreManager; + })(); + + v1beta1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.filestore.v1beta1 + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {Array.|null} [modes] NetworkConfig modes + * @property {string|null} [reservedIpRange] NetworkConfig reservedIpRange + * @property {Array.|null} [ipAddresses] NetworkConfig ipAddresses + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.filestore.v1beta1.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + this.modes = []; + this.ipAddresses = []; + if (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.filestore.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig modes. + * @member {Array.} modes + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.modes = $util.emptyArray; + + /** + * NetworkConfig reservedIpRange. + * @member {string} reservedIpRange + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.reservedIpRange = ""; + + /** + * NetworkConfig ipAddresses. + * @member {Array.} ipAddresses + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.ipAddresses = $util.emptyArray; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @static + * @param {google.cloud.filestore.v1beta1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.filestore.v1beta1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.modes != null && message.modes.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.modes.length; ++i) + writer.int32(message.modes[i]); + writer.ldelim(); + } + if (message.reservedIpRange != null && Object.hasOwnProperty.call(message, "reservedIpRange")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.reservedIpRange); + if (message.ipAddresses != null && message.ipAddresses.length) + for (var i = 0; i < message.ipAddresses.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.ipAddresses[i]); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1beta1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.network = reader.string(); + break; + case 3: + if (!(message.modes && message.modes.length)) + message.modes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modes.push(reader.int32()); + } else + message.modes.push(reader.int32()); + break; + case 4: + message.reservedIpRange = reader.string(); + break; + case 5: + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(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.filestore.v1beta1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.modes != null && message.hasOwnProperty("modes")) { + if (!Array.isArray(message.modes)) + return "modes: array expected"; + for (var i = 0; i < message.modes.length; ++i) + switch (message.modes[i]) { + default: + return "modes: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + if (!$util.isString(message.reservedIpRange)) + return "reservedIpRange: string expected"; + if (message.ipAddresses != null && message.hasOwnProperty("ipAddresses")) { + if (!Array.isArray(message.ipAddresses)) + return "ipAddresses: array expected"; + for (var i = 0; i < message.ipAddresses.length; ++i) + if (!$util.isString(message.ipAddresses[i])) + return "ipAddresses: 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.filestore.v1beta1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.NetworkConfig) + return object; + var message = new $root.google.cloud.filestore.v1beta1.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + if (object.modes) { + if (!Array.isArray(object.modes)) + throw TypeError(".google.cloud.filestore.v1beta1.NetworkConfig.modes: array expected"); + message.modes = []; + for (var i = 0; i < object.modes.length; ++i) + switch (object.modes[i]) { + default: + case "ADDRESS_MODE_UNSPECIFIED": + case 0: + message.modes[i] = 0; + break; + case "MODE_IPV4": + case 1: + message.modes[i] = 1; + break; + } + } + if (object.reservedIpRange != null) + message.reservedIpRange = String(object.reservedIpRange); + if (object.ipAddresses) { + if (!Array.isArray(object.ipAddresses)) + throw TypeError(".google.cloud.filestore.v1beta1.NetworkConfig.ipAddresses: array expected"); + message.ipAddresses = []; + for (var i = 0; i < object.ipAddresses.length; ++i) + message.ipAddresses[i] = String(object.ipAddresses[i]); + } + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @static + * @param {google.cloud.filestore.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.arrays || options.defaults) { + object.modes = []; + object.ipAddresses = []; + } + if (options.defaults) { + object.network = ""; + object.reservedIpRange = ""; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.modes && message.modes.length) { + object.modes = []; + for (var j = 0; j < message.modes.length; ++j) + object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; + } + if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) + object.reservedIpRange = message.reservedIpRange; + if (message.ipAddresses && message.ipAddresses.length) { + object.ipAddresses = []; + for (var j = 0; j < message.ipAddresses.length; ++j) + object.ipAddresses[j] = message.ipAddresses[j]; + } + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AddressMode enum. + * @name google.cloud.filestore.v1beta1.NetworkConfig.AddressMode + * @enum {number} + * @property {number} ADDRESS_MODE_UNSPECIFIED=0 ADDRESS_MODE_UNSPECIFIED value + * @property {number} MODE_IPV4=1 MODE_IPV4 value + */ + NetworkConfig.AddressMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ADDRESS_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MODE_IPV4"] = 1; + return values; + })(); + + return NetworkConfig; + })(); + + v1beta1.FileShareConfig = (function() { + + /** + * Properties of a FileShareConfig. + * @memberof google.cloud.filestore.v1beta1 + * @interface IFileShareConfig + * @property {string|null} [name] FileShareConfig name + * @property {number|Long|null} [capacityGb] FileShareConfig capacityGb + * @property {string|null} [sourceBackup] FileShareConfig sourceBackup + * @property {Array.|null} [nfsExportOptions] FileShareConfig nfsExportOptions + */ + + /** + * Constructs a new FileShareConfig. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a FileShareConfig. + * @implements IFileShareConfig + * @constructor + * @param {google.cloud.filestore.v1beta1.IFileShareConfig=} [properties] Properties to set + */ + function FileShareConfig(properties) { + this.nfsExportOptions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FileShareConfig name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.name = ""; + + /** + * FileShareConfig capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * FileShareConfig sourceBackup. + * @member {string|null|undefined} sourceBackup + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.sourceBackup = null; + + /** + * FileShareConfig nfsExportOptions. + * @member {Array.} nfsExportOptions + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + */ + FileShareConfig.prototype.nfsExportOptions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * FileShareConfig source. + * @member {"sourceBackup"|undefined} source + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + */ + Object.defineProperty(FileShareConfig.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceBackup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new FileShareConfig instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1beta1.IFileShareConfig=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.FileShareConfig} FileShareConfig instance + */ + FileShareConfig.create = function create(properties) { + return new FileShareConfig(properties); + }; + + /** + * Encodes the specified FileShareConfig message. Does not implicitly {@link google.cloud.filestore.v1beta1.FileShareConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1beta1.IFileShareConfig} message FileShareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileShareConfig.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.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.capacityGb); + if (message.nfsExportOptions != null && message.nfsExportOptions.length) + for (var i = 0; i < message.nfsExportOptions.length; ++i) + $root.google.cloud.filestore.v1beta1.NfsExportOptions.encode(message.nfsExportOptions[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified FileShareConfig message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.FileShareConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1beta1.IFileShareConfig} message FileShareConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileShareConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.FileShareConfig} FileShareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileShareConfig.decode = function 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.filestore.v1beta1.FileShareConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.capacityGb = reader.int64(); + break; + case 9: + message.sourceBackup = reader.string(); + break; + case 8: + if (!(message.nfsExportOptions && message.nfsExportOptions.length)) + message.nfsExportOptions = []; + message.nfsExportOptions.push($root.google.cloud.filestore.v1beta1.NfsExportOptions.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileShareConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.FileShareConfig} FileShareConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileShareConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileShareConfig message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileShareConfig.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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + properties.source = 1; + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + } + if (message.nfsExportOptions != null && message.hasOwnProperty("nfsExportOptions")) { + if (!Array.isArray(message.nfsExportOptions)) + return "nfsExportOptions: array expected"; + for (var i = 0; i < message.nfsExportOptions.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.NfsExportOptions.verify(message.nfsExportOptions[i]); + if (error) + return "nfsExportOptions." + error; + } + } + return null; + }; + + /** + * Creates a FileShareConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.FileShareConfig} FileShareConfig + */ + FileShareConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.FileShareConfig) + return object; + var message = new $root.google.cloud.filestore.v1beta1.FileShareConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + if (object.nfsExportOptions) { + if (!Array.isArray(object.nfsExportOptions)) + throw TypeError(".google.cloud.filestore.v1beta1.FileShareConfig.nfsExportOptions: array expected"); + message.nfsExportOptions = []; + for (var i = 0; i < object.nfsExportOptions.length; ++i) { + if (typeof object.nfsExportOptions[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.FileShareConfig.nfsExportOptions: object expected"); + message.nfsExportOptions[i] = $root.google.cloud.filestore.v1beta1.NfsExportOptions.fromObject(object.nfsExportOptions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileShareConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {google.cloud.filestore.v1beta1.FileShareConfig} message FileShareConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileShareConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nfsExportOptions = []; + if (options.defaults) { + object.name = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.nfsExportOptions && message.nfsExportOptions.length) { + object.nfsExportOptions = []; + for (var j = 0; j < message.nfsExportOptions.length; ++j) + object.nfsExportOptions[j] = $root.google.cloud.filestore.v1beta1.NfsExportOptions.toObject(message.nfsExportOptions[j], options); + } + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + object.sourceBackup = message.sourceBackup; + if (options.oneofs) + object.source = "sourceBackup"; + } + return object; + }; + + /** + * Converts this FileShareConfig to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @instance + * @returns {Object.} JSON object + */ + FileShareConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileShareConfig; + })(); + + v1beta1.NfsExportOptions = (function() { + + /** + * Properties of a NfsExportOptions. + * @memberof google.cloud.filestore.v1beta1 + * @interface INfsExportOptions + * @property {Array.|null} [ipRanges] NfsExportOptions ipRanges + * @property {google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode|null} [accessMode] NfsExportOptions accessMode + * @property {google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode|null} [squashMode] NfsExportOptions squashMode + * @property {number|Long|null} [anonUid] NfsExportOptions anonUid + * @property {number|Long|null} [anonGid] NfsExportOptions anonGid + */ + + /** + * Constructs a new NfsExportOptions. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a NfsExportOptions. + * @implements INfsExportOptions + * @constructor + * @param {google.cloud.filestore.v1beta1.INfsExportOptions=} [properties] Properties to set + */ + function NfsExportOptions(properties) { + this.ipRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NfsExportOptions ipRanges. + * @member {Array.} ipRanges + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.ipRanges = $util.emptyArray; + + /** + * NfsExportOptions accessMode. + * @member {google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode} accessMode + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.accessMode = 0; + + /** + * NfsExportOptions squashMode. + * @member {google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode} squashMode + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.squashMode = 0; + + /** + * NfsExportOptions anonUid. + * @member {number|Long} anonUid + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.anonUid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * NfsExportOptions anonGid. + * @member {number|Long} anonGid + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + */ + NfsExportOptions.prototype.anonGid = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new NfsExportOptions instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1beta1.INfsExportOptions=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.NfsExportOptions} NfsExportOptions instance + */ + NfsExportOptions.create = function create(properties) { + return new NfsExportOptions(properties); + }; + + /** + * Encodes the specified NfsExportOptions message. Does not implicitly {@link google.cloud.filestore.v1beta1.NfsExportOptions.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1beta1.INfsExportOptions} message NfsExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NfsExportOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipRanges != null && message.ipRanges.length) + for (var i = 0; i < message.ipRanges.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipRanges[i]); + if (message.accessMode != null && Object.hasOwnProperty.call(message, "accessMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.accessMode); + if (message.squashMode != null && Object.hasOwnProperty.call(message, "squashMode")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.squashMode); + if (message.anonUid != null && Object.hasOwnProperty.call(message, "anonUid")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.anonUid); + if (message.anonGid != null && Object.hasOwnProperty.call(message, "anonGid")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.anonGid); + return writer; + }; + + /** + * Encodes the specified NfsExportOptions message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.NfsExportOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1beta1.INfsExportOptions} message NfsExportOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NfsExportOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.NfsExportOptions} NfsExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NfsExportOptions.decode = function 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.filestore.v1beta1.NfsExportOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ipRanges && message.ipRanges.length)) + message.ipRanges = []; + message.ipRanges.push(reader.string()); + break; + case 2: + message.accessMode = reader.int32(); + break; + case 3: + message.squashMode = reader.int32(); + break; + case 4: + message.anonUid = reader.int64(); + break; + case 5: + message.anonGid = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NfsExportOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.NfsExportOptions} NfsExportOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NfsExportOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NfsExportOptions message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NfsExportOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ipRanges != null && message.hasOwnProperty("ipRanges")) { + if (!Array.isArray(message.ipRanges)) + return "ipRanges: array expected"; + for (var i = 0; i < message.ipRanges.length; ++i) + if (!$util.isString(message.ipRanges[i])) + return "ipRanges: string[] expected"; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) + switch (message.accessMode) { + default: + return "accessMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.squashMode != null && message.hasOwnProperty("squashMode")) + switch (message.squashMode) { + default: + return "squashMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.anonUid != null && message.hasOwnProperty("anonUid")) + if (!$util.isInteger(message.anonUid) && !(message.anonUid && $util.isInteger(message.anonUid.low) && $util.isInteger(message.anonUid.high))) + return "anonUid: integer|Long expected"; + if (message.anonGid != null && message.hasOwnProperty("anonGid")) + if (!$util.isInteger(message.anonGid) && !(message.anonGid && $util.isInteger(message.anonGid.low) && $util.isInteger(message.anonGid.high))) + return "anonGid: integer|Long expected"; + return null; + }; + + /** + * Creates a NfsExportOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.NfsExportOptions} NfsExportOptions + */ + NfsExportOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.NfsExportOptions) + return object; + var message = new $root.google.cloud.filestore.v1beta1.NfsExportOptions(); + if (object.ipRanges) { + if (!Array.isArray(object.ipRanges)) + throw TypeError(".google.cloud.filestore.v1beta1.NfsExportOptions.ipRanges: array expected"); + message.ipRanges = []; + for (var i = 0; i < object.ipRanges.length; ++i) + message.ipRanges[i] = String(object.ipRanges[i]); + } + switch (object.accessMode) { + case "ACCESS_MODE_UNSPECIFIED": + case 0: + message.accessMode = 0; + break; + case "READ_ONLY": + case 1: + message.accessMode = 1; + break; + case "READ_WRITE": + case 2: + message.accessMode = 2; + break; + } + switch (object.squashMode) { + case "SQUASH_MODE_UNSPECIFIED": + case 0: + message.squashMode = 0; + break; + case "NO_ROOT_SQUASH": + case 1: + message.squashMode = 1; + break; + case "ROOT_SQUASH": + case 2: + message.squashMode = 2; + break; + } + if (object.anonUid != null) + if ($util.Long) + (message.anonUid = $util.Long.fromValue(object.anonUid)).unsigned = false; + else if (typeof object.anonUid === "string") + message.anonUid = parseInt(object.anonUid, 10); + else if (typeof object.anonUid === "number") + message.anonUid = object.anonUid; + else if (typeof object.anonUid === "object") + message.anonUid = new $util.LongBits(object.anonUid.low >>> 0, object.anonUid.high >>> 0).toNumber(); + if (object.anonGid != null) + if ($util.Long) + (message.anonGid = $util.Long.fromValue(object.anonGid)).unsigned = false; + else if (typeof object.anonGid === "string") + message.anonGid = parseInt(object.anonGid, 10); + else if (typeof object.anonGid === "number") + message.anonGid = object.anonGid; + else if (typeof object.anonGid === "object") + message.anonGid = new $util.LongBits(object.anonGid.low >>> 0, object.anonGid.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a NfsExportOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {google.cloud.filestore.v1beta1.NfsExportOptions} message NfsExportOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NfsExportOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ipRanges = []; + if (options.defaults) { + object.accessMode = options.enums === String ? "ACCESS_MODE_UNSPECIFIED" : 0; + object.squashMode = options.enums === String ? "SQUASH_MODE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.anonUid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.anonUid = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.anonGid = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.anonGid = options.longs === String ? "0" : 0; + } + if (message.ipRanges && message.ipRanges.length) { + object.ipRanges = []; + for (var j = 0; j < message.ipRanges.length; ++j) + object.ipRanges[j] = message.ipRanges[j]; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) + object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; + if (message.squashMode != null && message.hasOwnProperty("squashMode")) + object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; + if (message.anonUid != null && message.hasOwnProperty("anonUid")) + if (typeof message.anonUid === "number") + object.anonUid = options.longs === String ? String(message.anonUid) : message.anonUid; + else + object.anonUid = options.longs === String ? $util.Long.prototype.toString.call(message.anonUid) : options.longs === Number ? new $util.LongBits(message.anonUid.low >>> 0, message.anonUid.high >>> 0).toNumber() : message.anonUid; + if (message.anonGid != null && message.hasOwnProperty("anonGid")) + if (typeof message.anonGid === "number") + object.anonGid = options.longs === String ? String(message.anonGid) : message.anonGid; + else + object.anonGid = options.longs === String ? $util.Long.prototype.toString.call(message.anonGid) : options.longs === Number ? new $util.LongBits(message.anonGid.low >>> 0, message.anonGid.high >>> 0).toNumber() : message.anonGid; + return object; + }; + + /** + * Converts this NfsExportOptions to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @instance + * @returns {Object.} JSON object + */ + NfsExportOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * AccessMode enum. + * @name google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode + * @enum {number} + * @property {number} ACCESS_MODE_UNSPECIFIED=0 ACCESS_MODE_UNSPECIFIED value + * @property {number} READ_ONLY=1 READ_ONLY value + * @property {number} READ_WRITE=2 READ_WRITE value + */ + NfsExportOptions.AccessMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_ONLY"] = 1; + values[valuesById[2] = "READ_WRITE"] = 2; + return values; + })(); + + /** + * SquashMode enum. + * @name google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode + * @enum {number} + * @property {number} SQUASH_MODE_UNSPECIFIED=0 SQUASH_MODE_UNSPECIFIED value + * @property {number} NO_ROOT_SQUASH=1 NO_ROOT_SQUASH value + * @property {number} ROOT_SQUASH=2 ROOT_SQUASH value + */ + NfsExportOptions.SquashMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SQUASH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NO_ROOT_SQUASH"] = 1; + values[valuesById[2] = "ROOT_SQUASH"] = 2; + return values; + })(); + + return NfsExportOptions; + })(); + + v1beta1.Instance = (function() { + + /** + * Properties of an Instance. + * @memberof google.cloud.filestore.v1beta1 + * @interface IInstance + * @property {string|null} [name] Instance name + * @property {string|null} [description] Instance description + * @property {google.cloud.filestore.v1beta1.Instance.State|null} [state] Instance state + * @property {string|null} [statusMessage] Instance statusMessage + * @property {google.protobuf.ITimestamp|null} [createTime] Instance createTime + * @property {google.cloud.filestore.v1beta1.Instance.Tier|null} [tier] Instance tier + * @property {Object.|null} [labels] Instance labels + * @property {Array.|null} [fileShares] Instance fileShares + * @property {Array.|null} [networks] Instance networks + * @property {string|null} [etag] Instance etag + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Instance satisfiesPzs + */ + + /** + * Constructs a new Instance. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents an Instance. + * @implements IInstance + * @constructor + * @param {google.cloud.filestore.v1beta1.IInstance=} [properties] Properties to set + */ + function Instance(properties) { + this.labels = {}; + this.fileShares = []; + this.networks = []; + if (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.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.name = ""; + + /** + * Instance description. + * @member {string} description + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.description = ""; + + /** + * Instance state. + * @member {google.cloud.filestore.v1beta1.Instance.State} state + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.state = 0; + + /** + * Instance statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.statusMessage = ""; + + /** + * Instance createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.createTime = null; + + /** + * Instance tier. + * @member {google.cloud.filestore.v1beta1.Instance.Tier} tier + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.tier = 0; + + /** + * Instance labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.labels = $util.emptyObject; + + /** + * Instance fileShares. + * @member {Array.} fileShares + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.fileShares = $util.emptyArray; + + /** + * Instance networks. + * @member {Array.} networks + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.networks = $util.emptyArray; + + /** + * Instance etag. + * @member {string} etag + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.etag = ""; + + /** + * Instance satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.satisfiesPzs = null; + + /** + * Creates a new Instance instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.Instance + * @static + * @param {google.cloud.filestore.v1beta1.IInstance=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.Instance} Instance instance + */ + Instance.create = function create(properties) { + return new Instance(properties); + }; + + /** + * Encodes the specified Instance message. Does not implicitly {@link google.cloud.filestore.v1beta1.Instance.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.Instance + * @static + * @param {google.cloud.filestore.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.state); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.statusMessage); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.tier); + 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 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.fileShares != null && message.fileShares.length) + for (var i = 0; i < message.fileShares.length; ++i) + $root.google.cloud.filestore.v1beta1.FileShareConfig.encode(message.fileShares[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.networks != null && message.networks.length) + for (var i = 0; i < message.networks.length; ++i) + $root.google.cloud.filestore.v1beta1.NetworkConfig.encode(message.networks[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Instance message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Instance.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.Instance + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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 5: + message.state = reader.int32(); + break; + case 6: + message.statusMessage = reader.string(); + break; + case 7: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 8: + message.tier = reader.int32(); + break; + case 9: + 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 10: + if (!(message.fileShares && message.fileShares.length)) + message.fileShares = []; + message.fileShares.push($root.google.cloud.filestore.v1beta1.FileShareConfig.decode(reader, reader.uint32())); + break; + case 11: + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.filestore.v1beta1.NetworkConfig.decode(reader, reader.uint32())); + break; + case 12: + message.etag = reader.string(); + break; + case 13: + message.satisfiesPzs = $root.google.protobuf.BoolValue.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.filestore.v1beta1.Instance + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.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 6: + case 7: + break; + } + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: 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.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + break; + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.fileShares != null && message.hasOwnProperty("fileShares")) { + if (!Array.isArray(message.fileShares)) + return "fileShares: array expected"; + for (var i = 0; i < message.fileShares.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.FileShareConfig.verify(message.fileShares[i]); + if (error) + return "fileShares." + error; + } + } + if (message.networks != null && message.hasOwnProperty("networks")) { + if (!Array.isArray(message.networks)) + return "networks: array expected"; + for (var i = 0; i < message.networks.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.NetworkConfig.verify(message.networks[i]); + if (error) + return "networks." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + return null; + }; + + /** + * Creates an Instance message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.Instance + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.Instance} Instance + */ + Instance.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.Instance) + return object; + var message = new $root.google.cloud.filestore.v1beta1.Instance(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "REPAIRING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "ERROR": + case 6: + message.state = 6; + break; + case "RESTORING": + case 7: + message.state = 7; + break; + } + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Instance.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.tier) { + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "STANDARD": + case 1: + message.tier = 1; + break; + case "PREMIUM": + case 2: + message.tier = 2; + break; + case "BASIC_HDD": + case 3: + message.tier = 3; + break; + case "BASIC_SSD": + case 4: + message.tier = 4; + break; + case "HIGH_SCALE_SSD": + case 6: + message.tier = 6; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.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.fileShares) { + if (!Array.isArray(object.fileShares)) + throw TypeError(".google.cloud.filestore.v1beta1.Instance.fileShares: array expected"); + message.fileShares = []; + for (var i = 0; i < object.fileShares.length; ++i) { + if (typeof object.fileShares[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Instance.fileShares: object expected"); + message.fileShares[i] = $root.google.cloud.filestore.v1beta1.FileShareConfig.fromObject(object.fileShares[i]); + } + } + if (object.networks) { + if (!Array.isArray(object.networks)) + throw TypeError(".google.cloud.filestore.v1beta1.Instance.networks: array expected"); + message.networks = []; + for (var i = 0; i < object.networks.length; ++i) { + if (typeof object.networks[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Instance.networks: object expected"); + message.networks[i] = $root.google.cloud.filestore.v1beta1.NetworkConfig.fromObject(object.networks[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Instance.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + return message; + }; + + /** + * Creates a plain object from an Instance message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.Instance + * @static + * @param {google.cloud.filestore.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.fileShares = []; + object.networks = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.statusMessage = ""; + object.createTime = null; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.etag = ""; + object.satisfiesPzs = 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.State[message.state] : message.state; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.tier] : message.tier; + 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.fileShares && message.fileShares.length) { + object.fileShares = []; + for (var j = 0; j < message.fileShares.length; ++j) + object.fileShares[j] = $root.google.cloud.filestore.v1beta1.FileShareConfig.toObject(message.fileShares[j], options); + } + if (message.networks && message.networks.length) { + object.networks = []; + for (var j = 0; j < message.networks.length; ++j) + object.networks[j] = $root.google.cloud.filestore.v1beta1.NetworkConfig.toObject(message.networks[j], options); + } + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + return object; + }; + + /** + * Converts this Instance to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + * @returns {Object.} JSON object + */ + Instance.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.filestore.v1beta1.Instance.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} REPAIRING=3 REPAIRING value + * @property {number} DELETING=4 DELETING value + * @property {number} ERROR=6 ERROR value + * @property {number} RESTORING=7 RESTORING value + */ + Instance.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "REPAIRING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[6] = "ERROR"] = 6; + values[valuesById[7] = "RESTORING"] = 7; + return values; + })(); + + /** + * Tier enum. + * @name google.cloud.filestore.v1beta1.Instance.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} PREMIUM=2 PREMIUM value + * @property {number} BASIC_HDD=3 BASIC_HDD value + * @property {number} BASIC_SSD=4 BASIC_SSD value + * @property {number} HIGH_SCALE_SSD=6 HIGH_SCALE_SSD value + */ + Instance.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "PREMIUM"] = 2; + values[valuesById[3] = "BASIC_HDD"] = 3; + values[valuesById[4] = "BASIC_SSD"] = 4; + values[valuesById[6] = "HIGH_SCALE_SSD"] = 6; + return values; + })(); + + return Instance; + })(); + + v1beta1.CreateInstanceRequest = (function() { + + /** + * Properties of a CreateInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface ICreateInstanceRequest + * @property {string|null} [parent] CreateInstanceRequest parent + * @property {string|null} [instanceId] CreateInstanceRequest instanceId + * @property {google.cloud.filestore.v1beta1.IInstance|null} [instance] CreateInstanceRequest instance + */ + + /** + * Constructs a new CreateInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a CreateInstanceRequest. + * @implements ICreateInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.parent = ""; + + /** + * CreateInstanceRequest instanceId. + * @member {string} instanceId + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instanceId = ""; + + /** + * CreateInstanceRequest instance. + * @member {google.cloud.filestore.v1beta1.IInstance|null|undefined} instance + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @instance + */ + CreateInstanceRequest.prototype.instance = null; + + /** + * Creates a new CreateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.CreateInstanceRequest} CreateInstanceRequest instance + */ + CreateInstanceRequest.create = function create(properties) { + return new CreateInstanceRequest(properties); + }; + + /** + * Encodes the specified CreateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1beta1.CreateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.CreateInstanceRequest} CreateInstanceRequest + */ + CreateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.CreateInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1beta1.CreateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.filestore.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.filestore.v1beta1.CreateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1beta1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this CreateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.CreateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + CreateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateInstanceRequest; + })(); + + v1beta1.GetInstanceRequest = (function() { + + /** + * Properties of a GetInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IGetInstanceRequest + * @property {string|null} [name] GetInstanceRequest name + */ + + /** + * Constructs a new GetInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a GetInstanceRequest. + * @implements IGetInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.GetInstanceRequest + * @instance + */ + GetInstanceRequest.prototype.name = ""; + + /** + * Creates a new GetInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.GetInstanceRequest} GetInstanceRequest instance + */ + GetInstanceRequest.create = function create(properties) { + return new GetInstanceRequest(properties); + }; + + /** + * Encodes the specified GetInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1beta1.GetInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.GetInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.v1beta1.GetInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.GetInstanceRequest} GetInstanceRequest + */ + GetInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.GetInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1beta1.GetInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1beta1.GetInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + GetInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetInstanceRequest; + })(); + + v1beta1.UpdateInstanceRequest = (function() { + + /** + * Properties of an UpdateInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IUpdateInstanceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateInstanceRequest updateMask + * @property {google.cloud.filestore.v1beta1.IInstance|null} [instance] UpdateInstanceRequest instance + */ + + /** + * Constructs a new UpdateInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents an UpdateInstanceRequest. + * @implements IUpdateInstanceRequest + * @constructor + * @param {google.cloud.filestore.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 updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.updateMask = null; + + /** + * UpdateInstanceRequest instance. + * @member {google.cloud.filestore.v1beta1.IInstance|null|undefined} instance + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @instance + */ + UpdateInstanceRequest.prototype.instance = null; + + /** + * Creates a new UpdateInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest instance + */ + UpdateInstanceRequest.create = function create(properties) { + return new UpdateInstanceRequest(properties); + }; + + /** + * Encodes the specified UpdateInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.instance != null && Object.hasOwnProperty.call(message, "instance")) + $root.google.cloud.filestore.v1beta1.Instance.encode(message.instance, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1beta1.UpdateInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 2: + message.instance = $root.google.cloud.filestore.v1beta1.Instance.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.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.instance != null && message.hasOwnProperty("instance")) { + var error = $root.google.cloud.filestore.v1beta1.Instance.verify(message.instance); + if (error) + return "instance." + error; + } + return null; + }; + + /** + * Creates an UpdateInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.UpdateInstanceRequest} UpdateInstanceRequest + */ + UpdateInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.UpdateInstanceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateInstanceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.instance != null) { + if (typeof object.instance !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateInstanceRequest.instance: object expected"); + message.instance = $root.google.cloud.filestore.v1beta1.Instance.fromObject(object.instance); + } + return message; + }; + + /** + * Creates a plain object from an UpdateInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @static + * @param {google.cloud.filestore.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.updateMask = null; + object.instance = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.instance != null && message.hasOwnProperty("instance")) + object.instance = $root.google.cloud.filestore.v1beta1.Instance.toObject(message.instance, options); + return object; + }; + + /** + * Converts this UpdateInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.UpdateInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateInstanceRequest; + })(); + + v1beta1.RestoreInstanceRequest = (function() { + + /** + * Properties of a RestoreInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IRestoreInstanceRequest + * @property {string|null} [name] RestoreInstanceRequest name + * @property {string|null} [fileShare] RestoreInstanceRequest fileShare + * @property {string|null} [sourceSnapshot] RestoreInstanceRequest sourceSnapshot + * @property {string|null} [sourceBackup] RestoreInstanceRequest sourceBackup + */ + + /** + * Constructs a new RestoreInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a RestoreInstanceRequest. + * @implements IRestoreInstanceRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest=} [properties] Properties to set + */ + function RestoreInstanceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreInstanceRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.name = ""; + + /** + * RestoreInstanceRequest fileShare. + * @member {string} fileShare + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.fileShare = ""; + + /** + * RestoreInstanceRequest sourceSnapshot. + * @member {string|null|undefined} sourceSnapshot + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.sourceSnapshot = null; + + /** + * RestoreInstanceRequest sourceBackup. + * @member {string|null|undefined} sourceBackup + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + */ + RestoreInstanceRequest.prototype.sourceBackup = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreInstanceRequest source. + * @member {"sourceSnapshot"|"sourceBackup"|undefined} source + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + */ + Object.defineProperty(RestoreInstanceRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["sourceSnapshot", "sourceBackup"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.RestoreInstanceRequest} RestoreInstanceRequest instance + */ + RestoreInstanceRequest.create = function create(properties) { + return new RestoreInstanceRequest(properties); + }; + + /** + * Encodes the specified RestoreInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.RestoreInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest} message RestoreInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInstanceRequest.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.fileShare != null && Object.hasOwnProperty.call(message, "fileShare")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.fileShare); + if (message.sourceSnapshot != null && Object.hasOwnProperty.call(message, "sourceSnapshot")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.sourceSnapshot); + if (message.sourceBackup != null && Object.hasOwnProperty.call(message, "sourceBackup")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceBackup); + return writer; + }; + + /** + * Encodes the specified RestoreInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.RestoreInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IRestoreInstanceRequest} message RestoreInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.RestoreInstanceRequest} RestoreInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInstanceRequest.decode = function 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.filestore.v1beta1.RestoreInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.fileShare = reader.string(); + break; + case 3: + message.sourceSnapshot = reader.string(); + break; + case 4: + message.sourceBackup = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreInstanceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.RestoreInstanceRequest} RestoreInstanceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreInstanceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreInstanceRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreInstanceRequest.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.fileShare != null && message.hasOwnProperty("fileShare")) + if (!$util.isString(message.fileShare)) + return "fileShare: string expected"; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + properties.source = 1; + if (!$util.isString(message.sourceSnapshot)) + return "sourceSnapshot: string expected"; + } + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.sourceBackup)) + return "sourceBackup: string expected"; + } + return null; + }; + + /** + * Creates a RestoreInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.RestoreInstanceRequest} RestoreInstanceRequest + */ + RestoreInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.RestoreInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.RestoreInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.fileShare != null) + message.fileShare = String(object.fileShare); + if (object.sourceSnapshot != null) + message.sourceSnapshot = String(object.sourceSnapshot); + if (object.sourceBackup != null) + message.sourceBackup = String(object.sourceBackup); + return message; + }; + + /** + * Creates a plain object from a RestoreInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.RestoreInstanceRequest} message RestoreInstanceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreInstanceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.fileShare = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.fileShare != null && message.hasOwnProperty("fileShare")) + object.fileShare = message.fileShare; + if (message.sourceSnapshot != null && message.hasOwnProperty("sourceSnapshot")) { + object.sourceSnapshot = message.sourceSnapshot; + if (options.oneofs) + object.source = "sourceSnapshot"; + } + if (message.sourceBackup != null && message.hasOwnProperty("sourceBackup")) { + object.sourceBackup = message.sourceBackup; + if (options.oneofs) + object.source = "sourceBackup"; + } + return object; + }; + + /** + * Converts this RestoreInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestoreInstanceRequest; + })(); + + v1beta1.DeleteInstanceRequest = (function() { + + /** + * Properties of a DeleteInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + */ + + /** + * Constructs a new DeleteInstanceRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest + * @instance + */ + DeleteInstanceRequest.prototype.name = ""; + + /** + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest instance + */ + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; + + /** + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteInstanceRequest; + })(); + + v1beta1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @property {string|null} [filter] ListInstancesRequest filter + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.filter = ""; + + /** + * Creates a new ListInstancesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListInstancesRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListInstancesRequest} ListInstancesRequest instance + */ + ListInstancesRequest.create = function create(properties) { + return new ListInstancesRequest(properties); + }; + + /** + * Encodes the specified ListInstancesRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListInstancesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListInstancesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.orderBy = reader.string(); + break; + case 5: + message.filter = 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.filestore.v1beta1.ListInstancesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: 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.filestore.v1beta1.ListInstancesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListInstancesRequest} ListInstancesRequest + */ + ListInstancesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListInstancesRequest) + return object; + var message = new $root.google.cloud.filestore.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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListInstancesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @static + * @param {google.cloud.filestore.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.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListInstancesRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.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.filestore.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.filestore.v1beta1 + * @classdesc Represents a ListInstancesResponse. + * @implements IListInstancesResponse + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.instances = $util.emptyArray; + + /** + * ListInstancesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.nextPageToken = ""; + + /** + * ListInstancesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1beta1.ListInstancesResponse + * @instance + */ + ListInstancesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListInstancesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListInstancesResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListInstancesResponse} ListInstancesResponse instance + */ + ListInstancesResponse.create = function create(properties) { + return new ListInstancesResponse(properties); + }; + + /** + * Encodes the specified ListInstancesResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListInstancesResponse} ListInstancesResponse + */ + ListInstancesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListInstancesResponse) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListInstancesResponse(); + if (object.instances) { + if (!Array.isArray(object.instances)) + throw TypeError(".google.cloud.filestore.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.filestore.v1beta1.ListInstancesResponse.instances: object expected"); + message.instances[i] = $root.google.cloud.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.v1beta1.ListInstancesResponse + * @instance + * @returns {Object.} JSON object + */ + ListInstancesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListInstancesResponse; + })(); + + v1beta1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.filestore.v1beta1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.cloud.filestore.v1beta1.Backup.State|null} [state] Backup state + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {Object.|null} [labels] Backup labels + * @property {number|Long|null} [capacityGb] Backup capacityGb + * @property {number|Long|null} [storageBytes] Backup storageBytes + * @property {string|null} [sourceInstance] Backup sourceInstance + * @property {string|null} [sourceFileShare] Backup sourceFileShare + * @property {google.cloud.filestore.v1beta1.Instance.Tier|null} [sourceInstanceTier] Backup sourceInstanceTier + * @property {number|Long|null} [downloadBytes] Backup downloadBytes + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Backup satisfiesPzs + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup state. + * @member {google.cloud.filestore.v1beta1.Backup.State} state + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup storageBytes. + * @member {number|Long} storageBytes + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.storageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup sourceInstance. + * @member {string} sourceInstance + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceInstance = ""; + + /** + * Backup sourceFileShare. + * @member {string} sourceFileShare + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceFileShare = ""; + + /** + * Backup sourceInstanceTier. + * @member {google.cloud.filestore.v1beta1.Instance.Tier} sourceInstanceTier + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceInstanceTier = 0; + + /** + * Backup downloadBytes. + * @member {number|Long} downloadBytes + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.downloadBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = null; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacityGb); + if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.storageBytes); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceInstance); + if (message.sourceFileShare != null && Object.hasOwnProperty.call(message, "sourceFileShare")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceFileShare); + if (message.sourceInstanceTier != null && Object.hasOwnProperty.call(message, "sourceInstanceTier")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sourceInstanceTier); + if (message.downloadBytes != null && Object.hasOwnProperty.call(message, "downloadBytes")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.downloadBytes); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function 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.filestore.v1beta1.Backup(), 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.state = reader.int32(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + case 6: + message.capacityGb = reader.int64(); + break; + case 7: + message.storageBytes = reader.int64(); + break; + case 8: + message.sourceInstance = reader.string(); + break; + case 9: + message.sourceFileShare = reader.string(); + break; + case 10: + message.sourceInstanceTier = reader.int32(); + break; + case 11: + message.downloadBytes = reader.int64(); + break; + case 12: + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) + return "storageBytes: integer|Long expected"; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + if (!$util.isString(message.sourceFileShare)) + return "sourceFileShare: string expected"; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + switch (message.sourceInstanceTier) { + default: + return "sourceInstanceTier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + break; + } + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (!$util.isInteger(message.downloadBytes) && !(message.downloadBytes && $util.isInteger(message.downloadBytes.low) && $util.isInteger(message.downloadBytes.high))) + return "downloadBytes: integer|Long expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.Backup) + return object; + var message = new $root.google.cloud.filestore.v1beta1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "FINALIZING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.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.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.storageBytes != null) + if ($util.Long) + (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; + else if (typeof object.storageBytes === "string") + message.storageBytes = parseInt(object.storageBytes, 10); + else if (typeof object.storageBytes === "number") + message.storageBytes = object.storageBytes; + else if (typeof object.storageBytes === "object") + message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.sourceFileShare != null) + message.sourceFileShare = String(object.sourceFileShare); + switch (object.sourceInstanceTier) { + case "TIER_UNSPECIFIED": + case 0: + message.sourceInstanceTier = 0; + break; + case "STANDARD": + case 1: + message.sourceInstanceTier = 1; + break; + case "PREMIUM": + case 2: + message.sourceInstanceTier = 2; + break; + case "BASIC_HDD": + case 3: + message.sourceInstanceTier = 3; + break; + case "BASIC_SSD": + case 4: + message.sourceInstanceTier = 4; + break; + case "HIGH_SCALE_SSD": + case 6: + message.sourceInstanceTier = 6; + break; + } + if (object.downloadBytes != null) + if ($util.Long) + (message.downloadBytes = $util.Long.fromValue(object.downloadBytes)).unsigned = false; + else if (typeof object.downloadBytes === "string") + message.downloadBytes = parseInt(object.downloadBytes, 10); + else if (typeof object.downloadBytes === "number") + message.downloadBytes = object.downloadBytes; + else if (typeof object.downloadBytes === "object") + message.downloadBytes = new $util.LongBits(object.downloadBytes.low >>> 0, object.downloadBytes.high >>> 0).toNumber(); + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageBytes = options.longs === String ? "0" : 0; + object.sourceInstance = ""; + object.sourceFileShare = ""; + object.sourceInstanceTier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.downloadBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.downloadBytes = options.longs === String ? "0" : 0; + object.satisfiesPzs = 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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Backup.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (typeof message.storageBytes === "number") + object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; + else + object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + object.sourceInstance = message.sourceInstance; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + object.sourceFileShare = message.sourceFileShare; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (typeof message.downloadBytes === "number") + object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; + else + object.downloadBytes = options.longs === String ? $util.Long.prototype.toString.call(message.downloadBytes) : options.longs === Number ? new $util.LongBits(message.downloadBytes.low >>> 0, message.downloadBytes.high >>> 0).toNumber() : message.downloadBytes; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.filestore.v1beta1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} FINALIZING=2 FINALIZING value + * @property {number} READY=3 READY value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "FINALIZING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Backup; + })(); + + v1beta1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [backupId] CreateBackupRequest backupId + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.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.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function 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.filestore.v1beta1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); + break; + case 3: + message.backupId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.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.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.CreateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); + } + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backup = null; + object.backupId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateBackupRequest; + })(); + + v1beta1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.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 DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function 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.filestore.v1beta1.DeleteBackupRequest(); + 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 DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteBackupRequest; + })(); + + v1beta1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IUpdateBackupRequest + * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, 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 UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function 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.filestore.v1beta1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.backup = $root.google.cloud.filestore.v1beta1.Backup.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 UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); + if (error) + return "backup." + 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateBackupRequest; + })(); + + v1beta1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.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 GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function 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.filestore.v1beta1.GetBackupRequest(); + 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 GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.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 GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.GetBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.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 GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetBackupRequest; + })(); + + v1beta1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {string|null} [filter] ListBackupsRequest filter + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function 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.filestore.v1beta1.ListBackupsRequest(); + 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.orderBy = reader.string(); + break; + case 5: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListBackupsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackupsRequest; + })(); + + v1beta1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + 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]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backups[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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function 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.filestore.v1beta1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.filestore.v1beta1.Backup.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 ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backups[i]); + if (error) + return "backups." + 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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.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 ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backups[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 ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListBackupsResponse; + })(); + + return v1beta1; + })(); + + return filestore; + })(); + + return cloud; + })(); + + google.api = (function() { + + /** + * Namespace api. + * @memberof google + * @namespace + */ + var api = {}; + + /** + * FieldBehavior enum. + * @name google.api.FieldBehavior + * @enum {number} + * @property {number} FIELD_BEHAVIOR_UNSPECIFIED=0 FIELD_BEHAVIOR_UNSPECIFIED value + * @property {number} OPTIONAL=1 OPTIONAL value + * @property {number} REQUIRED=2 REQUIRED value + * @property {number} OUTPUT_ONLY=3 OUTPUT_ONLY value + * @property {number} INPUT_ONLY=4 INPUT_ONLY value + * @property {number} IMMUTABLE=5 IMMUTABLE value + * @property {number} UNORDERED_LIST=6 UNORDERED_LIST value + */ + 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.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; + })(); + + 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.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; + })(); + + 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.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + 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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/packages/google-cloud-filestore/protos/protos.json b/packages/google-cloud-filestore/protos/protos.json new file mode 100644 index 00000000000..18136930a80 --- /dev/null +++ b/packages/google-cloud-filestore/protos/protos.json @@ -0,0 +1,3221 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "common": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/cloud/common;common", + "java_multiple_files": true, + "java_package": "com.google.cloud.common" + }, + "nested": { + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusDetail": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cancelRequested": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + } + } + }, + "filestore": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.Filestore.V1", + "go_package": "google.golang.org/genproto/googleapis/cloud/filestore/v1;filestore", + "java_multiple_files": true, + "java_outer_classname": "CloudFilestoreServiceProto", + "java_package": "com.google.cloud.filestore.v1", + "php_namespace": "Google\\Cloud\\Filestore\\V1" + }, + "nested": { + "CloudFilestoreManager": { + "options": { + "(google.api.default_host)": "file.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "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": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "RestoreInstance": { + "requestType": "RestoreInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/instances/*}:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/instances/*}:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "modes": { + "rule": "repeated", + "type": "AddressMode", + "id": 3 + }, + "reservedIpRange": { + "type": "string", + "id": 4 + }, + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AddressMode": { + "values": { + "ADDRESS_MODE_UNSPECIFIED": 0, + "MODE_IPV4": 1 + } + } + } + }, + "FileShareConfig": { + "oneofs": { + "source": { + "oneof": [ + "sourceBackup" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "capacityGb": { + "type": "int64", + "id": 2 + }, + "sourceBackup": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + }, + "nfsExportOptions": { + "rule": "repeated", + "type": "NfsExportOptions", + "id": 7 + } + } + }, + "NfsExportOptions": { + "fields": { + "ipRanges": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessMode": { + "type": "AccessMode", + "id": 2 + }, + "squashMode": { + "type": "SquashMode", + "id": 3 + }, + "anonUid": { + "type": "int64", + "id": 4 + }, + "anonGid": { + "type": "int64", + "id": 5 + } + }, + "nested": { + "AccessMode": { + "values": { + "ACCESS_MODE_UNSPECIFIED": 0, + "READ_ONLY": 1, + "READ_WRITE": 2 + } + }, + "SquashMode": { + "values": { + "SQUASH_MODE_UNSPECIFIED": 0, + "NO_ROOT_SQUASH": 1, + "ROOT_SQUASH": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "file.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 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tier": { + "type": "Tier", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "fileShares": { + "rule": "repeated", + "type": "FileShareConfig", + "id": 10 + }, + "networks": { + "rule": "repeated", + "type": "NetworkConfig", + "id": 11 + }, + "etag": { + "type": "string", + "id": 12 + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "REPAIRING": 3, + "DELETING": 4, + "ERROR": 6, + "RESTORING": 7 + } + }, + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "STANDARD": 1, + "PREMIUM": 2, + "BASIC_HDD": 3, + "BASIC_SSD": 4, + "HIGH_SCALE_SSD": 5 + } + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1 + }, + "instance": { + "type": "Instance", + "id": 2 + } + } + }, + "RestoreInstanceRequest": { + "oneofs": { + "source": { + "oneof": [ + "sourceBackup" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "fileShare": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceBackup": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "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 + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "file.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "capacityGb": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageBytes": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceInstance": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "sourceFileShare": { + "type": "string", + "id": 9 + }, + "sourceInstanceTier": { + "type": "Instance.Tier", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "downloadBytes": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "FINALIZING": 2, + "READY": 3, + "DELETING": 4 + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + }, + "v1beta1": { + "options": { + "csharp_namespace": "Google.Cloud.Filestore.V1Beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/filestore/v1beta1;filestore", + "java_multiple_files": true, + "java_outer_classname": "CloudFilestoreServiceProto", + "java_package": "com.google.cloud.filestore.v1beta1", + "php_namespace": "Google\\Cloud\\Filestore\\V1beta1", + "(google.api.resource_definition).type": "file.googleapis.com/Snapshot", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/snapshots/{snapshot}" + }, + "nested": { + "CloudFilestoreManager": { + "options": { + "(google.api.default_host)": "file.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListInstances": { + "requestType": "ListInstancesRequest", + "responseType": "ListInstancesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/instances", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/instances" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetInstance": { + "requestType": "GetInstanceRequest", + "responseType": "Instance", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/instances/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/instances/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "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": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "RestoreInstance": { + "requestType": "RestoreInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/instances/*}:restore", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/instances/*}:restore", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "google.cloud.common.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": "google.cloud.common.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": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateBackup": { + "requestType": "CreateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*}/backups", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "parent,backup,backup_id", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*}/backups", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "parent,backup,backup_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{backup.name=projects/*/locations/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{backup.name=projects/*/locations/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1 + }, + "modes": { + "rule": "repeated", + "type": "AddressMode", + "id": 3 + }, + "reservedIpRange": { + "type": "string", + "id": 4 + }, + "ipAddresses": { + "rule": "repeated", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "AddressMode": { + "values": { + "ADDRESS_MODE_UNSPECIFIED": 0, + "MODE_IPV4": 1 + } + } + } + }, + "FileShareConfig": { + "oneofs": { + "source": { + "oneof": [ + "sourceBackup" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "capacityGb": { + "type": "int64", + "id": 2 + }, + "sourceBackup": { + "type": "string", + "id": 9, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + }, + "nfsExportOptions": { + "rule": "repeated", + "type": "NfsExportOptions", + "id": 8 + } + } + }, + "NfsExportOptions": { + "fields": { + "ipRanges": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "accessMode": { + "type": "AccessMode", + "id": 2 + }, + "squashMode": { + "type": "SquashMode", + "id": 3 + }, + "anonUid": { + "type": "int64", + "id": 4 + }, + "anonGid": { + "type": "int64", + "id": 5 + } + }, + "nested": { + "AccessMode": { + "values": { + "ACCESS_MODE_UNSPECIFIED": 0, + "READ_ONLY": 1, + "READ_WRITE": 2 + } + }, + "SquashMode": { + "values": { + "SQUASH_MODE_UNSPECIFIED": 0, + "NO_ROOT_SQUASH": 1, + "ROOT_SQUASH": 2 + } + } + } + }, + "Instance": { + "options": { + "(google.api.resource).type": "file.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 + }, + "state": { + "type": "State", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "tier": { + "type": "Tier", + "id": 8 + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 9 + }, + "fileShares": { + "rule": "repeated", + "type": "FileShareConfig", + "id": 10 + }, + "networks": { + "rule": "repeated", + "type": "NetworkConfig", + "id": 11 + }, + "etag": { + "type": "string", + "id": 12 + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "REPAIRING": 3, + "DELETING": 4, + "ERROR": 6, + "RESTORING": 7 + } + }, + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "STANDARD": 1, + "PREMIUM": 2, + "BASIC_HDD": 3, + "BASIC_SSD": 4, + "HIGH_SCALE_SSD": 6 + } + } + } + }, + "CreateInstanceRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "instanceId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + } + } + }, + "UpdateInstanceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "instance": { + "type": "Instance", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RestoreInstanceRequest": { + "oneofs": { + "source": { + "oneof": [ + "sourceSnapshot", + "sourceBackup" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "fileShare": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sourceSnapshot": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Snapshot" + } + }, + "sourceBackup": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "DeleteInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + } + } + }, + "ListInstancesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "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 + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "file.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backups/{backup}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "capacityGb": { + "type": "int64", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "storageBytes": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceInstance": { + "type": "string", + "id": 8, + "options": { + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "sourceFileShare": { + "type": "string", + "id": 9 + }, + "sourceInstanceTier": { + "type": "Instance.Tier", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "downloadBytes": { + "type": "int64", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "FINALIZING": 2, + "READY": 3, + "DELETING": 4 + } + } + } + }, + "CreateBackupRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "backup": { + "type": "Backup", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Backup" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "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 + } + }, + "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" + }, + "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 + } + } + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Duration": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "DoubleValue": { + "fields": { + "value": { + "type": "double", + "id": 1 + } + } + }, + "FloatValue": { + "fields": { + "value": { + "type": "float", + "id": 1 + } + } + }, + "Int64Value": { + "fields": { + "value": { + "type": "int64", + "id": 1 + } + } + }, + "UInt64Value": { + "fields": { + "value": { + "type": "uint64", + "id": 1 + } + } + }, + "Int32Value": { + "fields": { + "value": { + "type": "int32", + "id": 1 + } + } + }, + "UInt32Value": { + "fields": { + "value": { + "type": "uint32", + "id": 1 + } + } + }, + "BoolValue": { + "fields": { + "value": { + "type": "bool", + "id": 1 + } + } + }, + "StringValue": { + "fields": { + "value": { + "type": "string", + "id": 1 + } + } + }, + "BytesValue": { + "fields": { + "value": { + "type": "bytes", + "id": 1 + } + } + } + } + }, + "longrunning": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.LongRunning", + "go_package": "google.golang.org/genproto/googleapis/longrunning;longrunning", + "java_multiple_files": true, + "java_outer_classname": "OperationsProto", + "java_package": "com.google.longrunning", + "php_namespace": "Google\\LongRunning" + }, + "nested": { + "operationInfo": { + "type": "google.longrunning.OperationInfo", + "id": 1049, + "extend": "google.protobuf.MethodOptions" + }, + "Operations": { + "options": { + "(google.api.default_host)": "longrunning.googleapis.com" + }, + "methods": { + "ListOperations": { + "requestType": "ListOperationsRequest", + "responseType": "ListOperationsResponse", + "options": { + "(google.api.http).get": "/v1/{name=operations}", + "(google.api.method_signature)": "name,filter" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations}" + } + }, + { + "(google.api.method_signature)": "name,filter" + } + ] + }, + "GetOperation": { + "requestType": "GetOperationRequest", + "responseType": "Operation", + "options": { + "(google.api.http).get": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteOperation": { + "requestType": "DeleteOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v1/{name=operations/**}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=operations/**}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CancelOperation": { + "requestType": "CancelOperationRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).post": "/v1/{name=operations/**}:cancel", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=operations/**}:cancel", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "WaitOperation": { + "requestType": "WaitOperationRequest", + "responseType": "Operation" + } + } + }, + "Operation": { + "oneofs": { + "result": { + "oneof": [ + "error", + "response" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "metadata": { + "type": "google.protobuf.Any", + "id": 2 + }, + "done": { + "type": "bool", + "id": 3 + }, + "error": { + "type": "google.rpc.Status", + "id": 4 + }, + "response": { + "type": "google.protobuf.Any", + "id": 5 + } + } + }, + "GetOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListOperationsRequest": { + "fields": { + "name": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 1 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListOperationsResponse": { + "fields": { + "operations": { + "rule": "repeated", + "type": "Operation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CancelOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "DeleteOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "WaitOperationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "timeout": { + "type": "google.protobuf.Duration", + "id": 2 + } + } + }, + "OperationInfo": { + "fields": { + "responseType": { + "type": "string", + "id": 1 + }, + "metadataType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "rpc": { + "options": { + "cc_enable_arenas": true, + "go_package": "google.golang.org/genproto/googleapis/rpc/status;status", + "java_multiple_files": true, + "java_outer_classname": "StatusProto", + "java_package": "com.google.rpc", + "objc_class_prefix": "RPC" + }, + "nested": { + "Status": { + "fields": { + "code": { + "type": "int32", + "id": 1 + }, + "message": { + "type": "string", + "id": 2 + }, + "details": { + "rule": "repeated", + "type": "google.protobuf.Any", + "id": 3 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/packages/google-cloud-filestore/samples/README.md b/packages/google-cloud-filestore/samples/README.md new file mode 100644 index 00000000000..37aedb225b6 --- /dev/null +++ b/packages/google-cloud-filestore/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 + +# [Filestore: Node.js Samples](https://github.com/googleapis/nodejs-filestore) + +[![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-filestore#using-the-client-library). + +`cd samples` + +`npm install` + +`cd ..` + +## Samples + + + +### Quickstart + +View the [source code](https://github.com/googleapis/nodejs-filestore/blob/master/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-filestore&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-filestore&page=editor&open_in_editor=samples/README.md +[product-docs]: https://cloud.google.com/filestore/ diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json new file mode 100644 index 00000000000..c8a059a9fee --- /dev/null +++ b/packages/google-cloud-filestore/samples/package.json @@ -0,0 +1,22 @@ +{ + "name": "nodejs-filestore-samples", + "private": true, + "license": "Apache-2.0", + "author": "Google LLC", + "engines": { + "node": ">=12" + }, + "files": [ + "*.js" + ], + "scripts": { + "test": "c8 mocha --timeout 600000 test/*.js" + }, + "dependencies": { + "@google-cloud/filestore": "^0.1.0" + }, + "devDependencies": { + "c8": "^7.3.0", + "mocha": "^8.1.1" + } +} diff --git a/packages/google-cloud-filestore/samples/quickstart.js b/packages/google-cloud-filestore/samples/quickstart.js new file mode 100644 index 00000000000..abf60ead9fb --- /dev/null +++ b/packages/google-cloud-filestore/samples/quickstart.js @@ -0,0 +1,43 @@ +// 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'; + +async function main(projectId, location) { + // [START filestore_quickstart] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + // const projectId = 'my-project'; + // const location = 'us-central1-a'; + + // Imports the Google Cloud Some API library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore'); + const client = new CloudFilestoreManagerClient(); + async function listInstances() { + for await (const instance of client.listInstancesAsync({ + parent: `projects/${projectId}/locations/${location}`, + })) { + console.info(instance); + } + } + listInstances(); + // [END filestore_quickstart] +} + +main(...process.argv.slice(2)); +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); diff --git a/packages/google-cloud-filestore/samples/test/quickstart.js b/packages/google-cloud-filestore/samples/test/quickstart.js new file mode 100644 index 00000000000..4664a2658ea --- /dev/null +++ b/packages/google-cloud-filestore/samples/test/quickstart.js @@ -0,0 +1,34 @@ +// 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'; + +const path = require('path'); +const assert = require('assert'); +const cp = require('child_process'); +const {describe, it} = require('mocha'); + +const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); + +const cwd = path.join(__dirname, '..'); + +const project = process.env.GCLOUD_PROJECT; +const location = 'us-central1-a'; + +describe('Quickstart', () => { + it('should run quickstart', async () => { + const out = execSync(`node ./quickstart.js ${project} ${location}`, {cwd}); + assert.strictEqual(out.includes('fileShares'), true); + }); +}); diff --git a/packages/google-cloud-filestore/src/index.ts b/packages/google-cloud-filestore/src/index.ts new file mode 100644 index 00000000000..890bc401302 --- /dev/null +++ b/packages/google-cloud-filestore/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 CloudFilestoreManagerClient = v1.CloudFilestoreManagerClient; +type CloudFilestoreManagerClient = v1.CloudFilestoreManagerClient; + +export {v1, v1beta1, CloudFilestoreManagerClient}; +export default {v1, v1beta1, CloudFilestoreManagerClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts new file mode 100644 index 00000000000..050d5305e80 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -0,0 +1,2244 @@ +// 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/cloud_filestore_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_filestore_manager_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Filestore resources. + * + * Cloud Filestore Manager v1. + * + * The `file.googleapis.com` service implements the Cloud Filestore API and + * defines the following resource model for managing instances: + * * The service works with a collection of cloud projects, named: `/projects/*` + * * Each project has a collection of available locations, named: `/locations/*` + * * Each location has a collection of instances and backups, named: + * `/instances/*` and `/backups/*` respectively. + * * As such, Cloud Filestore instances are resources of the form: + * `/projects/{project_number}/locations/{location_id}/instances/{instance_id}` + * and backups are resources of the form: + * `/projects/{project_number}/locations/{location_id}/backup/{backup_id}` + * + * Note that location_id must be a GCP `zone` for instances and but to a GCP + * `region` for backups; for example: + * * `projects/12345/locations/us-central1-c/instances/my-filestore` + * * `projects/12345/locations/us-central1/backups/my-backup` + * @class + * @memberof v1 + */ +export class CloudFilestoreManagerClient { + 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; + cloudFilestoreManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudFilestoreManagerClient. + * + * @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 CloudFilestoreManagerClient; + 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 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 = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + 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, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups' + ), + }; + + 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.filestore.v1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const restoreInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1.Instance' + ) as gax.protobuf.Type; + const restoreInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1.Backup' + ) as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1.Backup' + ) as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), + restoreInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreInstanceResponse.decode.bind(restoreInstanceResponse), + restoreInstanceMetadata.decode.bind(restoreInstanceMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata) + ), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata) + ), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.filestore.v1.CloudFilestoreManager', + 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.cloudFilestoreManagerStub) { + return this.cloudFilestoreManagerStub; + } + + // Put together the "service stub" for + // google.cloud.filestore.v1.CloudFilestoreManager. + this.cloudFilestoreManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.filestore.v1.CloudFilestoreManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.filestore.v1.CloudFilestoreManager, + 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 cloudFilestoreManagerStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'restoreInstance', + 'deleteInstance', + 'listBackups', + 'getBackup', + 'createBackup', + 'deleteBackup', + 'updateBackup', + ]; + for (const methodName of cloudFilestoreManagerStubMethods) { + const callPromise = this.cloudFilestoreManagerStub.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.cloudFilestoreManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'file.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 'file.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.filestore.v1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.filestore.v1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.filestore.v1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.filestore.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.filestore.v1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.filestore.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the details of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * projects/{project_id}/locations/{location}/instances/{instance_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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.filestore.v1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1.IInstance, + | protos.google.cloud.filestore.v1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.filestore.v1.IGetInstanceRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.filestore.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); + } + getBackup( + request?: protos.google.cloud.filestore.v1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | undefined, + {} | undefined + ] + >; + getBackup( + request: protos.google.cloud.filestore.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.cloud.filestore.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the details of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * projects/{project_number}/locations/{location}/backups/{backup_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1.Backup}. + * 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.getBackup(request); + */ + getBackup( + request?: protos.google.cloud.filestore.v1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.filestore.v1.IGetBackupRequest | 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.getBackup(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.filestore.v1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.filestore.v1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.filestore.v1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an instance. + * When creating from a backup, the capacity of the new instance needs to be + * equal to or larger than the capacity of the backup (and also equal to or + * larger than the minimum capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance's project and location, in the format + * projects/{project_id}/locations/{location}. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + * @param {string} request.instanceId + * Required. The name of the instance to create. + * The name must be unique for the specified project and location. + * @param {google.cloud.filestore.v1.Instance} request.instance + * Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.instances) + * @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.filestore.v1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.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< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + updateInstance( + request?: protos.google.cloud.filestore.v1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.filestore.v1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.filestore.v1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the settings of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * + * * "description" + * * "file_shares" + * * "labels" + * @param {google.cloud.filestore.v1.Instance} request.instance + * Only fields specified in update_mask are updated. + * @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.filestore.v1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.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< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + restoreInstance( + request?: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + restoreInstance( + request: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreInstance( + request: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Restores an existing instance's file share from a backup. + * + * The capacity of the instance needs to be equal to or larger than the + * capacity of the backup (and also equal to or larger than the minimum + * capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the instance, in the format + * projects/{project_number}/locations/{location_id}/instances/{instance_id}. + * @param {string} request.fileShare + * Required. Name of the file share in the Cloud Filestore instance that the backup + * is being restored to. + * @param {string} request.sourceBackup + * The resource name of the backup, in the format + * projects/{project_number}/locations/{location_id}/backups/{backup_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.restoreInstance(request); + * const [response] = await operation.promise(); + */ + restoreInstance( + request?: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restoreInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restoreInstance()`. + * @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 checkRestoreInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestoreInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.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.restoreInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + deleteInstance( + request?: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * projects/{project_id}/locations/{location}/instances/{instance_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.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< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + createBackup( + request?: protos.google.cloud.filestore.v1.ICreateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createBackup( + request: protos.google.cloud.filestore.v1.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackup( + request: protos.google.cloud.filestore.v1.ICreateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup's project and location, in the format + * projects/{project_number}/locations/{location}. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + * @param {google.cloud.filestore.v1.Backup} request.backup + * Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * @param {string} request.backupId + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * Values that do not match this pattern will trigger an INVALID_ARGUMENT + * error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createBackup(request); + * const [response] = await operation.promise(); + */ + createBackup( + request?: protos.google.cloud.filestore.v1.ICreateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackup()`. + * @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 checkCreateBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1.Backup, + protos.google.cloud.common.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.createBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + deleteBackup( + request?: protos.google.cloud.filestore.v1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteBackup( + request: protos.google.cloud.filestore.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.filestore.v1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * projects/{project_number}/locations/{location}/backups/{backup_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteBackup(request); + * const [response] = await operation.promise(); + */ + deleteBackup( + request?: protos.google.cloud.filestore.v1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackup()`. + * @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 checkDeleteBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.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.deleteBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + updateBackup( + request?: protos.google.cloud.filestore.v1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateBackup( + request: protos.google.cloud.filestore.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.filestore.v1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the settings of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1.Backup} request.backup + * Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * @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.updateBackup(request); + * const [response] = await operation.promise(); + */ + updateBackup( + request?: protos.google.cloud.filestore.v1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'backup.name': request.backup!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateBackup()`. + * @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 checkUpdateBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1.Backup, + protos.google.cloud.common.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.updateBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + listInstances( + request?: protos.google.cloud.filestore.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IInstance[], + protos.google.cloud.filestore.v1.IListInstancesRequest | null, + protos.google.cloud.filestore.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.filestore.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.filestore.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + > + ): void; + /** + * Lists all instances in a project for either a specified location + * or for all locations. + * + * @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_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.v1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + > + ): Promise< + [ + protos.google.cloud.filestore.v1.IInstance[], + protos.google.cloud.filestore.v1.IListInstancesRequest | null, + protos.google.cloud.filestore.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 + * Required. The project and location for which to retrieve instance information, + * in the format projects/{project_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.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 callSettings = new gax.CallSettings(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 + * Required. The project and location for which to retrieve instance information, + * in the format projects/{project_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listBackups( + request?: protos.google.cloud.filestore.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IBackup[], + protos.google.cloud.filestore.v1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.filestore.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.filestore.v1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.filestore.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.filestore.v1.IBackup + > + ): void; + /** + * Lists all backups in a project for either a specified location or for all + * locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup information, + * in the format projects/{project_number}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Backup]{@link google.cloud.filestore.v1.Backup}. + * 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 `listBackupsAsync()` + * 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. + */ + listBackups( + request?: protos.google.cloud.filestore.v1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + | protos.google.cloud.filestore.v1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.filestore.v1.IBackup + > + ): Promise< + [ + protos.google.cloud.filestore.v1.IBackup[], + protos.google.cloud.filestore.v1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1.IListBackupsResponse + ] + > | 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.listBackups(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 backup information, + * in the format projects/{project_number}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Backup]{@link google.cloud.filestore.v1.Backup} 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 `listBackupsAsync()` + * 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. + */ + listBackupsStream( + request?: protos.google.cloud.filestore.v1.IListBackupsRequest, + 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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackups`, 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 backup information, + * in the format projects/{project_number}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 + * [Backup]{@link google.cloud.filestore.v1.Backup}. 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.listBackupsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listBackupsAsync( + request?: protos.google.cloud.filestore.v1.IListBackupsRequest, + 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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project: string, location: string, backup: string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * 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 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. + * + * 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.cloudFilestoreManagerStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client_config.json b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client_config.json new file mode 100644 index 00000000000..fc1ccfd6ee2 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client_config.json @@ -0,0 +1,93 @@ +{ + "interfaces": { + "google.cloud.filestore.v1.CloudFilestoreManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "9442ca297df43f7314712e1a19d003838e738a45": { + "initial_retry_delay_millis": 250, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 32000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "CreateInstance": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 14400000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreInstance": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "CreateBackup": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_proto_list.json b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_proto_list.json new file mode 100644 index 00000000000..b5434ceeae8 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/common/operation_metadata.proto", + "../../protos/google/cloud/filestore/v1/cloud_filestore_service.proto" +] diff --git a/packages/google-cloud-filestore/src/v1/gapic_metadata.json b/packages/google-cloud-filestore/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..92789f7b7f6 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1/gapic_metadata.json @@ -0,0 +1,141 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.filestore.v1", + "libraryPackage": "@google-cloud/filestore", + "services": { + "CloudFilestoreManager": { + "clients": { + "grpc": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestoreInstance": { + "methods": [ + "restoreInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestoreInstance": { + "methods": [ + "restoreInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-filestore/src/v1/index.ts b/packages/google-cloud-filestore/src/v1/index.ts new file mode 100644 index 00000000000..0f214d8ceae --- /dev/null +++ b/packages/google-cloud-filestore/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 {CloudFilestoreManagerClient} from './cloud_filestore_manager_client'; diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts new file mode 100644 index 00000000000..bbda5caf9f8 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -0,0 +1,2324 @@ +// 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/cloud_filestore_manager_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './cloud_filestore_manager_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Configures and manages Cloud Filestore resources. + * + * Cloud Filestore Manager v1beta1. + * + * The `file.googleapis.com` service implements the Cloud Filestore API and + * defines the following model for managing resources: + * * The service works with a collection of cloud projects, named: `/projects/*` + * * Each project has a collection of available locations, named: `/locations/*` + * * Each location has a collection of instances and backups, named: + * `/instances/*` and `/backups/*` respectively. + * * As such, Cloud Filestore instances are resources of the form: + * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` + * backups are resources of the form: + * `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` + * + * Note that location_id can represent a GCP `zone` or `region` depending on the + * resource. + * for example: + * A zonal Filestore instance: + * * `projects/my-project/locations/us-central1-c/instances/my-basic-tier-filer` + * A regional Filestore instance: + * * `projects/my-project/locations/us-central1/instances/my-enterprise-filer` + * @class + * @memberof v1beta1 + */ +export class CloudFilestoreManagerClient { + 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; + cloudFilestoreManagerStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of CloudFilestoreManagerClient. + * + * @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 CloudFilestoreManagerClient; + 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 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 = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backups/{backup}' + ), + instancePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + snapshotPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/snapshots/{snapshot}' + ), + }; + + // 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 = { + listInstances: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'instances' + ), + listBackups: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'backups' + ), + }; + + 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.filestore.v1beta1.Instance' + ) as gax.protobuf.Type; + const createInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Instance' + ) as gax.protobuf.Type; + const updateInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const restoreInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Instance' + ) as gax.protobuf.Type; + const restoreInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteInstanceResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const createBackupResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Backup' + ) as gax.protobuf.Type; + const createBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Backup' + ) as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createInstanceResponse.decode.bind(createInstanceResponse), + createInstanceMetadata.decode.bind(createInstanceMetadata) + ), + updateInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateInstanceResponse.decode.bind(updateInstanceResponse), + updateInstanceMetadata.decode.bind(updateInstanceMetadata) + ), + restoreInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreInstanceResponse.decode.bind(restoreInstanceResponse), + restoreInstanceMetadata.decode.bind(restoreInstanceMetadata) + ), + deleteInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteInstanceResponse.decode.bind(deleteInstanceResponse), + deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) + ), + createBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupResponse.decode.bind(createBackupResponse), + createBackupMetadata.decode.bind(createBackupMetadata) + ), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata) + ), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.filestore.v1beta1.CloudFilestoreManager', + 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.cloudFilestoreManagerStub) { + return this.cloudFilestoreManagerStub; + } + + // Put together the "service stub" for + // google.cloud.filestore.v1beta1.CloudFilestoreManager. + this.cloudFilestoreManagerStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.filestore.v1beta1.CloudFilestoreManager' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.filestore.v1beta1 + .CloudFilestoreManager, + 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 cloudFilestoreManagerStubMethods = [ + 'listInstances', + 'getInstance', + 'createInstance', + 'updateInstance', + 'restoreInstance', + 'deleteInstance', + 'listBackups', + 'getBackup', + 'createBackup', + 'deleteBackup', + 'updateBackup', + ]; + for (const methodName of cloudFilestoreManagerStubMethods) { + const callPromise = this.cloudFilestoreManagerStub.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.cloudFilestoreManagerStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'file.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 'file.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.filestore.v1beta1.IGetInstanceRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.filestore.v1beta1.IGetInstanceRequest | undefined, + {} | undefined + ] + >; + getInstance( + request: protos.google.cloud.filestore.v1beta1.IGetInstanceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IInstance, + | protos.google.cloud.filestore.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getInstance( + request: protos.google.cloud.filestore.v1beta1.IGetInstanceRequest, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IInstance, + | protos.google.cloud.filestore.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the details of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * projects/{project_id}/locations/{location}/instances/{instance_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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.filestore.v1beta1.IGetInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1beta1.IInstance, + | protos.google.cloud.filestore.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1beta1.IInstance, + | protos.google.cloud.filestore.v1beta1.IGetInstanceRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.filestore.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); + } + getBackup( + request?: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.IGetBackupRequest | undefined, + {} | undefined + ] + >; + getBackup( + request: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IBackup, + | protos.google.cloud.filestore.v1beta1.IGetBackupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getBackup( + request: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IBackup, + | protos.google.cloud.filestore.v1beta1.IGetBackupRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets the details of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * projects/{project_id}/locations/{location}/backups/{backup_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1beta1.Backup}. + * 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.getBackup(request); + */ + getBackup( + request?: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1beta1.IBackup, + | protos.google.cloud.filestore.v1beta1.IGetBackupRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1beta1.IBackup, + | protos.google.cloud.filestore.v1beta1.IGetBackupRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.IGetBackupRequest | 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.getBackup(request, options, callback); + } + + createInstance( + request?: protos.google.cloud.filestore.v1beta1.ICreateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createInstance( + request: protos.google.cloud.filestore.v1beta1.ICreateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createInstance( + request: protos.google.cloud.filestore.v1beta1.ICreateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates an instance. + * When creating from a backup, the capacity of the new instance needs to be + * equal to or larger than the capacity of the backup (and also equal to or + * larger than the minimum capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance's project and location, in the format + * projects/{project_id}/locations/{location}. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + * @param {string} request.instanceId + * Required. The ID of the instance to create. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @param {google.cloud.filestore.v1beta1.Instance} request.instance + * Required. A [instance resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + * @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.filestore.v1beta1.ICreateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.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< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + updateInstance( + request?: protos.google.cloud.filestore.v1beta1.IUpdateInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateInstance( + request: protos.google.cloud.filestore.v1beta1.IUpdateInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateInstance( + request: protos.google.cloud.filestore.v1beta1.IUpdateInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the settings of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * + * * "description" + * * "file_shares" + * * "labels" + * @param {google.cloud.filestore.v1beta1.Instance} request.instance + * Required. Only fields specified in update_mask are updated. + * @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.filestore.v1beta1.IUpdateInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.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< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + restoreInstance( + request?: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + restoreInstance( + request: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + restoreInstance( + request: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Restores an existing instance's file share from a backup. + * + * The capacity of the instance needs to be equal to or larger than the + * capacity of the backup (and also equal to or larger than the minimum + * capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the instance, in the format + * projects/{project_id}/locations/{location_id}/instances/{instance_id}. + * @param {string} request.fileShare + * Required. Name of the file share in the Cloud Filestore instance that the snapshot + * is being restored to. + * @param {string} request.sourceSnapshot + * The resource name of the snapshot, in the format + * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}. + * @param {string} request.sourceBackup + * The resource name of the backup, in the format + * projects/{project_id}/locations/{location_id}/backups/{backup_id}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.restoreInstance(request); + * const [response] = await operation.promise(); + */ + restoreInstance( + request?: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.restoreInstance(request, options, callback); + } + /** + * Check the status of the long running operation returned by `restoreInstance()`. + * @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 checkRestoreInstanceProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkRestoreInstanceProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.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.restoreInstance, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Instance, + protos.google.cloud.common.OperationMetadata + >; + } + deleteInstance( + request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteInstance( + request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteInstance( + request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * projects/{project_id}/locations/{location}/instances/{instance_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteInstance(request); + * const [response] = await operation.promise(); + */ + deleteInstance( + request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + 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< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.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< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + createBackup( + request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createBackup( + request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackup( + request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup's project and location, in the format + * projects/{project_id}/locations/{location}. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * @param {string} request.backupId + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @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.createBackup(request); + * const [response] = await operation.promise(); + */ + createBackup( + request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackup()`. + * @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 checkCreateBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.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.createBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + deleteBackup( + request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteBackup( + request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * projects/{project_id}/locations/{location}/backups/{backup_id} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteBackup(request); + * const [response] = await operation.promise(); + */ + deleteBackup( + request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackup()`. + * @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 checkDeleteBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.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.deleteBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + updateBackup( + request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateBackup( + request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the settings of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A [backup resource] + * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * @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.updateBackup(request); + * const [response] = await operation.promise(); + */ + updateBackup( + request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + gax.routingHeader.fromParams({ + 'backup.name': request.backup!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateBackup()`. + * @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 checkUpdateBackupProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.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.updateBackup, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + listInstances( + request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance[], + protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, + protos.google.cloud.filestore.v1beta1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; + /** + * Lists all instances in a project for either a specified location + * or for all locations. + * + * @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_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.v1beta1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance[], + protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, + protos.google.cloud.filestore.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 + * Required. The project and location for which to retrieve instance information, + * in the format projects/{project_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.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 callSettings = new gax.CallSettings(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 + * Required. The project and location for which to retrieve instance information, + * in the format projects/{project_id}/locations/{location}. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the {location} + * value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listInstances.asyncIterate( + this.innerApiCalls['listInstances'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + listBackups( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup[], + protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1beta1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; + /** + * Lists all backups in a project for either a specified location or for all + * locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup information, + * in the format projects/{project_id}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Backup]{@link google.cloud.filestore.v1beta1.Backup}. + * 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 `listBackupsAsync()` + * 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. + */ + listBackups( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup[], + protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1beta1.IListBackupsResponse + ] + > | 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.listBackups(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 backup information, + * in the format projects/{project_id}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Backup]{@link google.cloud.filestore.v1beta1.Backup} 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 `listBackupsAsync()` + * 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. + */ + listBackupsStream( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + 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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listBackups`, 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 backup information, + * in the format projects/{project_id}/locations/{location}. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * {location} value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 + * [Backup]{@link google.cloud.filestore.v1beta1.Backup}. 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.listBackupsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listBackupsAsync( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + 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 callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as unknown as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project: string, location: string, backup: string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * 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 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 snapshot resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} snapshot + * @returns {string} Resource name string. + */ + snapshotPath(project: string, location: string, snapshot: string) { + return this.pathTemplates.snapshotPathTemplate.render({ + project: project, + location: location, + snapshot: snapshot, + }); + } + + /** + * Parse the project from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the project. + */ + matchProjectFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).project; + } + + /** + * Parse the location from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the location. + */ + matchLocationFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).location; + } + + /** + * Parse the snapshot from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the snapshot. + */ + matchSnapshotFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).snapshot; + } + + /** + * 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.cloudFilestoreManagerStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json new file mode 100644 index 00000000000..628a32b92d9 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json @@ -0,0 +1,93 @@ +{ + "interfaces": { + "google.cloud.filestore.v1beta1.CloudFilestoreManager": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "9442ca297df43f7314712e1a19d003838e738a45": { + "initial_retry_delay_millis": 250, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 32000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListInstances": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetInstance": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "CreateInstance": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateInstance": { + "timeout_millis": 14400000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreInstance": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteInstance": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "CreateBackup": { + "timeout_millis": 60000000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackup": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_proto_list.json b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_proto_list.json new file mode 100644 index 00000000000..848c8cd0b65 --- /dev/null +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_proto_list.json @@ -0,0 +1,4 @@ +[ + "../../protos/google/cloud/common/operation_metadata.proto", + "../../protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto" +] diff --git a/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json b/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000000..efd3287373f --- /dev/null +++ b/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json @@ -0,0 +1,141 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.filestore.v1beta1", + "libraryPackage": "@google-cloud/filestore", + "services": { + "CloudFilestoreManager": { + "clients": { + "grpc": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestoreInstance": { + "methods": [ + "restoreInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "CloudFilestoreManagerClient", + "rpcs": { + "GetInstance": { + "methods": [ + "getInstance" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "CreateInstance": { + "methods": [ + "createInstance" + ] + }, + "UpdateInstance": { + "methods": [ + "updateInstance" + ] + }, + "RestoreInstance": { + "methods": [ + "restoreInstance" + ] + }, + "DeleteInstance": { + "methods": [ + "deleteInstance" + ] + }, + "CreateBackup": { + "methods": [ + "createBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "ListInstances": { + "methods": [ + "listInstances", + "listInstancesStream", + "listInstancesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + } + } + } + } + } + } +} diff --git a/packages/google-cloud-filestore/src/v1beta1/index.ts b/packages/google-cloud-filestore/src/v1beta1/index.ts new file mode 100644 index 00000000000..0f214d8ceae --- /dev/null +++ b/packages/google-cloud-filestore/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 {CloudFilestoreManagerClient} from './cloud_filestore_manager_client'; diff --git a/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.js b/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..3e3856b8467 --- /dev/null +++ b/packages/google-cloud-filestore/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 filestore = require('@google-cloud/filestore'); + +function main() { + const cloudFilestoreManagerClient = + new filestore.CloudFilestoreManagerClient(); +} + +main(); diff --git a/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..97448a3c4b3 --- /dev/null +++ b/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,34 @@ +// 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 {CloudFilestoreManagerClient} from '@google-cloud/filestore'; + +// check that the client class type name can be used +function doStuffWithCloudFilestoreManagerClient( + client: CloudFilestoreManagerClient +) { + client.close(); +} + +function main() { + // check that the client instance can be created + const cloudFilestoreManagerClient = new CloudFilestoreManagerClient(); + doStuffWithCloudFilestoreManagerClient(cloudFilestoreManagerClient); +} + +main(); diff --git a/packages/google-cloud-filestore/system-test/install.ts b/packages/google-cloud-filestore/system-test/install.ts new file mode 100644 index 00000000000..d2d61c0396f --- /dev/null +++ b/packages/google-cloud-filestore/system-test/install.ts @@ -0,0 +1,51 @@ +// 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-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts new file mode 100644 index 00000000000..5f3a2249b7a --- /dev/null +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -0,0 +1,2619 @@ +// 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 cloudfilestoremanagerModule 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.CloudFilestoreManagerClient', () => { + it('has servicePath', () => { + const servicePath = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + await client.initialize(); + assert(client.cloudFilestoreManagerStub); + }); + + it('has close method', () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1.IBackup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getBackup with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.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 createInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.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 updateInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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('restoreInstance', () => { + it('invokes restoreInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes restoreInstance without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1.IInstance, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes restoreInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restoreInstance(request), expectedError); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes restoreInstance with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restoreInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRestoreInstanceProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkRestoreInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreInstanceProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkRestoreInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.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 deleteInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.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.filestore.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.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('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBackups without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1.IBackup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackups(request), expectedError); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBackupsStream without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1.Backup) => { + 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.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert.strictEqual( + (client.descriptors.page.listBackups.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert.strictEqual( + (client.descriptors.page.listBackups.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.filestore.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup: 'backupValue', + }; + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'locationValue', + 'backupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts new file mode 100644 index 00000000000..fbf853867c0 --- /dev/null +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -0,0 +1,2734 @@ +// 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 cloudfilestoremanagerModule 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.CloudFilestoreManagerClient', () => { + it('has servicePath', () => { + const servicePath = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient + .servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient + .apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + await client.initialize(); + assert(client.cloudFilestoreManagerStub); + }); + + it('has close method', () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ); + client.innerApiCalls.getInstance = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getInstance( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ); + client.innerApiCalls.getBackup = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.IBackup | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getBackup with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + assert( + (client.innerApiCalls.getBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createInstance', () => { + it('invokes createInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.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 createInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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('updateInstance', () => { + it('invokes updateInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.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 updateInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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('restoreInstance', () => { + it('invokes restoreInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreInstance(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes restoreInstance without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreInstance = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreInstance( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IInstance, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes restoreInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreInstance = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.restoreInstance(request), expectedError); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes restoreInstance with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreInstance = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.restoreInstance(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.restoreInstance as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkRestoreInstanceProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkRestoreInstanceProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreInstanceProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkRestoreInstanceProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.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 deleteInstance with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup = {}; + request.backup.name = ''; + const expectedHeaderRequestParams = 'backup.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.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('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBackups without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.IBackup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackups(request), expectedError); + assert( + (client.innerApiCalls.listBackups as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listBackupsStream without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Backup) => { + 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.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert.strictEqual( + (client.descriptors.page.listBackups.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert.strictEqual( + (client.descriptors.page.listBackups.createStream as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[2].otherArgs.headers['x-goog-request-params'], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('backup', () => { + const fakePath = '/rendered/path/backup'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + backup: 'backupValue', + }; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.backupPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.backupPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath( + 'projectValue', + 'locationValue', + 'backupValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, 'backupValue'); + assert( + (client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('instance', () => { + const fakePath = '/rendered/path/instance'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + }; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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('location', () => { + const fakePath = '/rendered/path/location'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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('snapshot', () => { + const fakePath = '/rendered/path/snapshot'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + snapshot: 'snapshotValue', + }; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.snapshotPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.snapshotPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('snapshotPath', () => { + const result = client.snapshotPath( + 'projectValue', + 'locationValue', + 'snapshotValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.snapshotPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromSnapshotName', () => { + const result = client.matchProjectFromSnapshotName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromSnapshotName', () => { + const result = client.matchLocationFromSnapshotName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSnapshotFromSnapshotName', () => { + const result = client.matchSnapshotFromSnapshotName(fakePath); + assert.strictEqual(result, 'snapshotValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-filestore/tsconfig.json b/packages/google-cloud-filestore/tsconfig.json new file mode 100644 index 00000000000..c78f1c884ef --- /dev/null +++ b/packages/google-cloud-filestore/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-filestore/webpack.config.js b/packages/google-cloud-filestore/webpack.config.js new file mode 100644 index 00000000000..04d9b139986 --- /dev/null +++ b/packages/google-cloud-filestore/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: 'CloudFilestoreManager', + filename: './cloud-filestore-manager.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 9256f3ae14d886dbe8b4c1f184ee453326ddb982 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 12:39:19 -0700 Subject: [PATCH 03/59] chore: release 1.0.0 (#3) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-filestore/CHANGELOG.md | 13 +++++++++++++ packages/google-cloud-filestore/package.json | 2 +- .../google-cloud-filestore/samples/package.json | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 packages/google-cloud-filestore/CHANGELOG.md diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md new file mode 100644 index 00000000000..2cc9f070376 --- /dev/null +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -0,0 +1,13 @@ +# Changelog + +## 1.0.0 (2021-07-21) + + +### ⚠ BREAKING CHANGES + +* initial generation of filestore API (#2) + +### Features + +* initial generation of filestore API ([#2](https://www.github.com/googleapis/nodejs-filestore/issues/2)) ([385821e](https://www.github.com/googleapis/nodejs-filestore/commit/385821e88e1036e780b4d7ca9c784e771afa024f)) +* initial stub of library ([59904e4](https://www.github.com/googleapis/nodejs-filestore/commit/59904e4219e4c8d2b5bd4a474d604ccd91647322)) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index ac1a18ff312..5cf992d3224 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "0.1.0", + "version": "1.0.0", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index c8a059a9fee..a4c0f6d0372 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^0.1.0" + "@google-cloud/filestore": "^1.0.0" }, "devDependencies": { "c8": "^7.3.0", From d21c4b79c958408f1f324c0e6216290644094c9e Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 23 Jul 2021 00:47:20 +0200 Subject: [PATCH 04/59] chore(deps): update dependency sinon to v11 (#5) --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 5cf992d3224..701a68e059b 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 257e553f8d34e12dd68261c1b3c5430576ef56d2 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 23 Jul 2021 00:52:31 +0200 Subject: [PATCH 05/59] chore(deps): update dependency mocha to v9 (#4) 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 | |---|---|---|---|---|---| | [mocha](https://mochajs.org/) ([source](https://togithub.com/mochajs/mocha)) | [`^8.1.1` -> `^9.0.0`](https://renovatebot.com/diffs/npm/mocha/8.4.0/9.0.2) | [![age](https://badges.renovateapi.com/packages/npm/mocha/9.0.2/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/mocha/9.0.2/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/mocha/9.0.2/compatibility-slim/8.4.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/mocha/9.0.2/confidence-slim/8.4.0)](https://docs.renovatebot.com/merge-confidence/) | | [@types/mocha](https://togithub.com/DefinitelyTyped/DefinitelyTyped) | [`^8.2.2` -> `^9.0.0`](https://renovatebot.com/diffs/npm/@types%2fmocha/8.2.3/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.0.0/compatibility-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/@types%2fmocha/9.0.0/confidence-slim/8.2.3)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
mochajs/mocha ### [`v9.0.2`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​902--2021-07-03) [Compare Source](https://togithub.com/mochajs/mocha/compare/v9.0.1...v9.0.2) #### :bug: Fixes - [#​4668](https://togithub.com/mochajs/mocha/issues/4668): ESM: make `--require ` work with new `import`-first loading ([**@​giltayar**](https://togithub.com/giltayar)) #### :nut_and_bolt: Other - [#​4674](https://togithub.com/mochajs/mocha/issues/4674): Update production dependencies ([**@​juergba**](https://togithub.com/juergba)) ### [`v9.0.1`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​901--2021-06-18) [Compare Source](https://togithub.com/mochajs/mocha/compare/v9.0.0...v9.0.1) #### :nut_and_bolt: Other - [#​4657](https://togithub.com/mochajs/mocha/issues/4657): Browser: add separate bundle for modern browsers ([**@​juergba**](https://togithub.com/juergba)) We added a separate browser bundle `mocha-es2018.js` in javascript ES2018, as we skipped the transpilation down to ES5. This is an **experimental step towards freezing Mocha's support of IE11**. - [#​4653](https://togithub.com/mochajs/mocha/issues/4653): ESM: proper version check in `hasStableEsmImplementation` ([**@​alexander-fenster**](https://togithub.com/alexander-fenster)) ### [`v9.0.0`](https://togithub.com/mochajs/mocha/blob/master/CHANGELOG.md#​900--2021-06-07) [Compare Source](https://togithub.com/mochajs/mocha/compare/v8.4.0...v9.0.0) #### :boom: Breaking Changes - [#​4633](https://togithub.com/mochajs/mocha/issues/4633): **Drop Node.js v10.x support** ([**@​juergba**](https://togithub.com/juergba)) - [#​4635](https://togithub.com/mochajs/mocha/issues/4635): `import`-first loading of test files ([**@​giltayar**](https://togithub.com/giltayar)) **Mocha is going ESM-first!** This means that it will now use ESM `import(test_file)` to load the test files, instead of the CommonJS `require(test_file)`. This is not a problem, as `import` can also load most files that `require` does. In the rare cases where this fails, it will fallback to `require(...)`. This ESM-first approach is the next step in Mocha's ESM migration, and allows ESM loaders to load and transform the test file. - [#​4636](https://togithub.com/mochajs/mocha/issues/4636): Remove deprecated `utils.lookupFiles()` ([**@​juergba**](https://togithub.com/juergba)) - [#​4638](https://togithub.com/mochajs/mocha/issues/4638): Limit the size of `actual`/`expected` for `diff` generation ([**@​juergba**](https://togithub.com/juergba)) - [#​4389](https://togithub.com/mochajs/mocha/issues/4389): Refactoring: Consuming log-symbols alternate to code for win32 in reporters/base ([**@​MoonSupport**](https://togithub.com/MoonSupport)) #### :tada: Enhancements - [#​4640](https://togithub.com/mochajs/mocha/issues/4640): Add new option `--dry-run` ([**@​juergba**](https://togithub.com/juergba)) #### :bug: Fixes - [#​4128](https://togithub.com/mochajs/mocha/issues/4128): Fix: control stringification of error message ([**@​syeutyu**](https://togithub.com/syeutyu)) #### :nut_and_bolt: Other - [#​4646](https://togithub.com/mochajs/mocha/issues/4646): Deprecate `Runner(suite: Suite, delay: boolean)` signature ([**@​juergba**](https://togithub.com/juergba)) - [#​4643](https://togithub.com/mochajs/mocha/issues/4643): Update production dependencies ([**@​juergba**](https://togithub.com/juergba))
--- ### 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 these updates again. --- - [ ] If you want to rebase/retry this PR, check this box. --- 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-filestore). --- packages/google-cloud-filestore/package.json | 4 ++-- packages/google-cloud-filestore/samples/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 701a68e059b..18f722f8a07 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -42,7 +42,7 @@ "google-gax": "^2.19.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-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index a4c0f6d0372..969b99a11c9 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "c8": "^7.3.0", - "mocha": "^8.1.1" + "mocha": "^9.0.0" } } From 6a9535ce40627a424b94b41cddbb90fc9d891941 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 30 Jul 2021 09:49:12 -0500 Subject: [PATCH 06/59] docs(filestore): Fix various formatting issues and broken links (#6) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(filestore): Fix various formatting issues and broken links PiperOrigin-RevId: 387410905 Source-Link: https://github.com/googleapis/googleapis/commit/b4967c737377d073125a2758c81357ceb100778f Source-Link: https://github.com/googleapis/googleapis-gen/commit/e85cdba236401ad6930d86eaebef0c411a1b11f0 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../v1/cloud_filestore_service.proto | 67 +++++++++--------- .../v1beta1/cloud_filestore_service.proto | 68 +++++++++---------- .../src/v1/cloud_filestore_manager_client.ts | 55 +++++++-------- .../v1beta1/cloud_filestore_manager_client.ts | 57 ++++++++-------- 4 files changed, 117 insertions(+), 130 deletions(-) diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto index 7959abf009e..3afd7e45084 100644 --- a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto @@ -197,7 +197,7 @@ message NetworkConfig { } // The name of the Google Compute Engine - // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. string network = 1; @@ -207,17 +207,17 @@ message NetworkConfig { // A /29 CIDR block in one of the // [internal IP address - // ranges](https://www.arin.net/knowledge/address_filters.html) that - // identifies the range of IP addresses reserved for this instance. For + // ranges](https://www.arin.net/reference/research/statistics/address_filters/) + // that identifies the range of IP addresses reserved for this instance. For // example, 10.0.0.0/29 or 192.168.0.0/29. The range you specify can't overlap // with either existing subnets or assigned IP address ranges for other Cloud // Filestore instances in the selected VPC network. string reserved_ip_range = 4; // Output only. IPv4 addresses in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format - // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block - // 7}:{block 8}. + // IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or + // IPv6 addresses in the format + // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`. repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -234,7 +234,7 @@ message FileShareConfig { // share is created from scratch. oneof source { // The resource name of the backup, in the format - // projects/{project_number}/locations/{location_id}/backups/{backup_id}, + // `projects/{project_number}/locations/{location_id}/backups/{backup_id}`, // that this file share has been restored from. string source_backup = 8 [(google.api.resource_reference) = { type: "file.googleapis.com/Backup" @@ -273,8 +273,8 @@ message NfsExportOptions { } // List of either an IPv4 addresses in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format + // `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the // file share. // Overlapping IP ranges are not allowed, both within and across // NfsExportOptions. An error will be returned. @@ -367,7 +367,7 @@ message Instance { } // Output only. The resource name of the instance, in the format - // projects/{project}/locations/{location}/instances/{instance}. + // `projects/{project}/locations/{location}/instances/{instance}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The description of the instance (2048 characters or less). @@ -407,7 +407,7 @@ message Instance { // CreateInstanceRequest creates an instance. message CreateInstanceRequest { // Required. The instance's project and location, in the format - // projects/{project_id}/locations/{location}. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Cloud Filestore, // locations map to GCP zones, for example **us-west1-b**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -420,15 +420,14 @@ message CreateInstanceRequest { // The name must be unique for the specified project and location. string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. A [instance resource] - // (/cloud-filestore/reference/rest/v1/projects.locations.instances) + // Required. An [instance resource][google.cloud.filestore.v1.Instance] Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; } // GetInstanceRequest gets the state of an instance. message GetInstanceRequest { // Required. The instance resource name, in the format - // projects/{project_id}/locations/{location}/instances/{instance_id}. + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -456,7 +455,7 @@ message UpdateInstanceRequest { // backup. message RestoreInstanceRequest { // Required. The resource name of the instance, in the format - // projects/{project_number}/locations/{location_id}/instances/{instance_id}. + // `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -470,7 +469,7 @@ message RestoreInstanceRequest { oneof source { // The resource name of the backup, in the format - // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + // `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. string source_backup = 3 [(google.api.resource_reference) = { type: "file.googleapis.com/Backup" }]; @@ -480,7 +479,7 @@ message RestoreInstanceRequest { // DeleteInstanceRequest deletes an instance. message DeleteInstanceRequest { // Required. The instance resource name, in the format - // projects/{project_id}/locations/{location}/instances/{instance_id} + // `projects/{project_id}/locations/{location}/instances/{instance_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -492,10 +491,10 @@ message DeleteInstanceRequest { // ListInstancesRequest lists instances. message ListInstancesRequest { // Required. The project and location for which to retrieve instance information, - // in the format projects/{project_id}/locations/{location}. In Cloud + // in the format `projects/{project_id}/locations/{location}`. In Cloud // Filestore, locations map to GCP zones, for example **us-west1-b**. To - // retrieve instance information for all locations, use "-" for the {location} - // value. + // retrieve instance information for all locations, use "-" for the + // `{location}` value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -521,8 +520,8 @@ message ListInstancesRequest { message ListInstancesResponse { // A list of instances in the project for the specified location. // - // If the {location} value in the request is "-", the response contains a list - // of instances from all locations. If any location is unreachable, the + // If the `{location}` value in the request is "-", the response contains a + // list of instances from all locations. If any location is unreachable, the // response will only return instances in reachable locations and the // "unreachable" field will be populated with a list of unreachable locations. repeated Instance instances = 1; @@ -562,7 +561,7 @@ message Backup { } // Output only. The resource name of the backup, in the format - // projects/{project_number}/locations/{location_id}/backups/{backup_id}. + // `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // A description of the backup with 2048 characters or less. @@ -586,7 +585,7 @@ message Backup { int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource name of the source Cloud Filestore instance, in the format - // projects/{project_number}/locations/{location_id}/instances/{instance_id}, + // `projects/{project_number}/locations/{location_id}/instances/{instance_id}`, // used to create this backup. string source_instance = 8 [(google.api.resource_reference) = { type: "file.googleapis.com/Instance" @@ -612,7 +611,7 @@ message Backup { // CreateBackupRequest creates a backup. message CreateBackupRequest { // Required. The backup's project and location, in the format - // projects/{project_number}/locations/{location}. In Cloud Filestore, + // `projects/{project_number}/locations/{location}`. In Cloud Filestore, // backup locations map to GCP regions, for example **us-west1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -621,8 +620,7 @@ message CreateBackupRequest { } ]; - // Required. A [backup resource] - // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + // Required. A [backup resource][google.cloud.filestore.v1.Backup] Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The ID to use for the backup. @@ -638,7 +636,7 @@ message CreateBackupRequest { // DeleteBackupRequest deletes a backup. message DeleteBackupRequest { // Required. The backup resource name, in the format - // projects/{project_number}/locations/{location}/backups/{backup_id} + // `projects/{project_number}/locations/{location}/backups/{backup_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -649,8 +647,7 @@ message DeleteBackupRequest { // UpdateBackupRequest updates description and/or labels for a backup. message UpdateBackupRequest { - // Required. A [backup resource] - // (/cloud-filestore/reference/rest/v1/projects.locations.backups) + // Required. A [backup resource][google.cloud.filestore.v1.Backup] Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Mask of fields to update. At least one path must be supplied in this @@ -661,7 +658,7 @@ message UpdateBackupRequest { // GetBackupRequest gets the state of a backup. message GetBackupRequest { // Required. The backup resource name, in the format - // projects/{project_number}/locations/{location}/backups/{backup_id}. + // `projects/{project_number}/locations/{location}/backups/{backup_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -673,11 +670,11 @@ message GetBackupRequest { // ListBackupsRequest lists backups. message ListBackupsRequest { // Required. The project and location for which to retrieve backup information, - // in the format projects/{project_number}/locations/{location}. + // in the format `projects/{project_number}/locations/{location}`. // In Cloud Filestore, backup locations map to GCP regions, // for example **us-west1**. // To retrieve backup information for all locations, use "-" for the - // {location} value. + // `{location}` value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -703,8 +700,8 @@ message ListBackupsRequest { message ListBackupsResponse { // A list of backups in the project for the specified location. // - // If the {location} value in the request is "-", the response contains a list - // of backups from all locations. If any location is unreachable, the + // If the `{location}` value in the request is "-", the response contains a + // list of backups from all locations. If any location is unreachable, the // response will only return backups in reachable locations and the // "unreachable" field will be populated with a list of unreachable // locations. diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto index 77b246c745a..8fd09e6bceb 100644 --- a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -205,7 +205,7 @@ message NetworkConfig { } // The name of the Google Compute Engine - // [VPC network](/compute/docs/networks-and-firewalls#networks) to which the + // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. string network = 1; @@ -215,17 +215,16 @@ message NetworkConfig { // A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the // [internal IP address - // ranges](https://www.arin.net/knowledge/address_filters.html) that - // identifies the range of IP addresses reserved for this instance. For + // ranges](https://www.arin.net/reference/research/statistics/address_filters/) + // that identifies the range of IP addresses reserved for this instance. For // example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap // with either existing subnets or assigned IP address ranges for other Cloud // Filestore instances in the selected VPC network. string reserved_ip_range = 4; // Output only. IPv4 addresses in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4} or IPv6 addresses in the format - // {block 1}:{block 2}:{block 3}:{block 4}:{block 5}:{block 6}:{block - // 7}:{block 8}. + // `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format + // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`. repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; } @@ -242,7 +241,7 @@ message FileShareConfig { // share is created from scratch. oneof source { // The resource name of the backup, in the format - // projects/{project_id}/locations/{location_id}/backups/{backup_id}, that + // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`, that // this file share has been restored from. string source_backup = 9 [(google.api.resource_reference) = { type: "file.googleapis.com/Backup" @@ -281,8 +280,8 @@ message NfsExportOptions { } // List of either an IPv4 addresses in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4} or CIDR ranges in the format - // {octet 1}.{octet 2}.{octet 3}.{octet 4}/{mask size} which may mount the + // `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format + // `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the // file share. // Overlapping IP ranges are not allowed, both within and across // NfsExportOptions. An error will be returned. @@ -375,7 +374,7 @@ message Instance { } // Output only. The resource name of the instance, in the format - // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // The description of the instance (2048 characters or less). @@ -415,7 +414,7 @@ message Instance { // CreateInstanceRequest creates an instance. message CreateInstanceRequest { // Required. The instance's project and location, in the format - // projects/{project_id}/locations/{location}. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Cloud Filestore, // locations map to GCP zones, for example **us-west1-b**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -431,15 +430,14 @@ message CreateInstanceRequest { // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - // Required. A [instance resource] - // (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + // Required. An [instance resource][google.cloud.filestore.v1beta1.Instance] Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; } // GetInstanceRequest gets the state of an instance. message GetInstanceRequest { // Required. The instance resource name, in the format - // projects/{project_id}/locations/{location}/instances/{instance_id}. + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -467,7 +465,7 @@ message UpdateInstanceRequest { // snapshot or backup. message RestoreInstanceRequest { // Required. The resource name of the instance, in the format - // projects/{project_id}/locations/{location_id}/instances/{instance_id}. + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -481,13 +479,13 @@ message RestoreInstanceRequest { oneof source { // The resource name of the snapshot, in the format - // projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}. + // `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`. string source_snapshot = 3 [(google.api.resource_reference) = { type: "file.googleapis.com/Snapshot" }]; // The resource name of the backup, in the format - // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. string source_backup = 4 [(google.api.resource_reference) = { type: "file.googleapis.com/Backup" }]; @@ -497,7 +495,7 @@ message RestoreInstanceRequest { // DeleteInstanceRequest deletes an instance. message DeleteInstanceRequest { // Required. The instance resource name, in the format - // projects/{project_id}/locations/{location}/instances/{instance_id} + // `projects/{project_id}/locations/{location}/instances/{instance_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -509,10 +507,10 @@ message DeleteInstanceRequest { // ListInstancesRequest lists instances. message ListInstancesRequest { // Required. The project and location for which to retrieve instance information, - // in the format projects/{project_id}/locations/{location}. In Cloud + // in the format `projects/{project_id}/locations/{location}`. In Cloud // Filestore, locations map to GCP zones, for example **us-west1-b**. To - // retrieve instance information for all locations, use "-" for the {location} - // value. + // retrieve instance information for all locations, use "-" for the + // `{location}` value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -538,8 +536,8 @@ message ListInstancesRequest { message ListInstancesResponse { // A list of instances in the project for the specified location. // - // If the {location} value in the request is "-", the response contains a list - // of instances from all locations. If any location is unreachable, the + // If the `{location}` value in the request is "-", the response contains a + // list of instances from all locations. If any location is unreachable, the // response will only return instances in reachable locations and the // "unreachable" field will be populated with a list of unreachable locations. repeated Instance instances = 1; @@ -579,7 +577,7 @@ message Backup { } // Output only. The resource name of the backup, in the format - // projects/{project_id}/locations/{location_id}/backups/{backup_id}. + // `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; // A description of the backup with 2048 characters or less. @@ -603,7 +601,7 @@ message Backup { int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource name of the source Cloud Filestore instance, in the format - // projects/{project_id}/locations/{location_id}/instances/{instance_id}, + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`, // used to create this backup. string source_instance = 8 [(google.api.resource_reference) = { type: "file.googleapis.com/Instance" @@ -627,7 +625,7 @@ message Backup { // CreateBackupRequest creates a backup. message CreateBackupRequest { // Required. The backup's project and location, in the format - // projects/{project_id}/locations/{location}. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Cloud Filestore, // backup locations map to GCP regions, for example **us-west1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -636,8 +634,7 @@ message CreateBackupRequest { } ]; - // Required. A [backup resource] - // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; // Required. The ID to use for the backup. @@ -651,7 +648,7 @@ message CreateBackupRequest { // DeleteBackupRequest deletes a backup. message DeleteBackupRequest { // Required. The backup resource name, in the format - // projects/{project_id}/locations/{location}/backups/{backup_id} + // `projects/{project_id}/locations/{location}/backups/{backup_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -662,8 +659,7 @@ message DeleteBackupRequest { // UpdateBackupRequest updates description and/or labels for a backup. message UpdateBackupRequest { - // Required. A [backup resource] - // (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + // Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; // Required. Mask of fields to update. At least one path must be supplied in this @@ -674,7 +670,7 @@ message UpdateBackupRequest { // GetBackupRequest gets the state of a backup. message GetBackupRequest { // Required. The backup resource name, in the format - // projects/{project_id}/locations/{location}/backups/{backup_id}. + // `projects/{project_id}/locations/{location}/backups/{backup_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -686,11 +682,11 @@ message GetBackupRequest { // ListBackupsRequest lists backups. message ListBackupsRequest { // Required. The project and location for which to retrieve backup information, - // in the format projects/{project_id}/locations/{location}. + // in the format `projects/{project_id}/locations/{location}`. // In Cloud Filestore, backup locations map to GCP regions, // for example **us-west1**. // To retrieve backup information for all locations, use "-" for the - // {location} value. + // `{location}` value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, (google.api.resource_reference) = { @@ -716,8 +712,8 @@ message ListBackupsRequest { message ListBackupsResponse { // A list of backups in the project for the specified location. // - // If the {location} value in the request is "-", the response contains a list - // of backups from all locations. If any location is unreachable, the + // If the `{location}` value in the request is "-", the response contains a + // list of backups from all locations. If any location is unreachable, the // response will only return backups in reachable locations and the // "unreachable" field will be populated with a list of unreachable // locations. diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 050d5305e80..cf06ed777f1 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -479,7 +479,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The instance resource name, in the format - * projects/{project_id}/locations/{location}/instances/{instance_id}. + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -565,7 +565,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The backup resource name, in the format - * projects/{project_number}/locations/{location}/backups/{backup_id}. + * `projects/{project_number}/locations/{location}/backups/{backup_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -662,14 +662,13 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The instance's project and location, in the format - * projects/{project_id}/locations/{location}. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, * locations map to GCP zones, for example **us-west1-b**. * @param {string} request.instanceId * Required. The name of the instance to create. * The name must be unique for the specified project and location. * @param {google.cloud.filestore.v1.Instance} request.instance - * Required. A [instance resource] - * (/cloud-filestore/reference/rest/v1/projects.locations.instances) + * Required. An {@link google.cloud.filestore.v1.Instance|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. @@ -964,13 +963,13 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The resource name of the instance, in the format - * projects/{project_number}/locations/{location_id}/instances/{instance_id}. + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. * @param {string} request.fileShare * Required. Name of the file share in the Cloud Filestore instance that the backup * is being restored to. * @param {string} request.sourceBackup * The resource name of the backup, in the format - * projects/{project_number}/locations/{location_id}/backups/{backup_id}. + * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1112,7 +1111,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The instance resource name, in the format - * projects/{project_id}/locations/{location}/instances/{instance_id} + * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1254,11 +1253,10 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The backup's project and location, in the format - * projects/{project_number}/locations/{location}. In Cloud Filestore, + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, * backup locations map to GCP regions, for example **us-west1**. * @param {google.cloud.filestore.v1.Backup} request.backup - * Required. A [backup resource] - * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} * @param {string} request.backupId * Required. The ID to use for the backup. * The ID must be unique within the specified project and location. @@ -1408,7 +1406,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The backup resource name, in the format - * projects/{project_number}/locations/{location}/backups/{backup_id} + * `projects/{project_number}/locations/{location}/backups/{backup_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1549,8 +1547,7 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.filestore.v1.Backup} request.backup - * Required. A [backup resource] - * (/cloud-filestore/reference/rest/v1/projects.locations.backups) + * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. At least one path must be supplied in this * field. @@ -1691,10 +1688,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1767,10 +1764,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1821,10 +1818,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1906,11 +1903,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_number}/locations/{location}. + * in the format `projects/{project_number}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1981,11 +1978,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_number}/locations/{location}. + * in the format `projects/{project_number}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2036,11 +2033,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_number}/locations/{location}. + * in the format `projects/{project_number}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index bbda5caf9f8..6e15797a829 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -490,7 +490,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The instance resource name, in the format - * projects/{project_id}/locations/{location}/instances/{instance_id}. + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -582,7 +582,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The backup resource name, in the format - * projects/{project_id}/locations/{location}/backups/{backup_id}. + * `projects/{project_id}/locations/{location}/backups/{backup_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -683,7 +683,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The instance's project and location, in the format - * projects/{project_id}/locations/{location}. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, * locations map to GCP zones, for example **us-west1-b**. * @param {string} request.instanceId * Required. The ID of the instance to create. @@ -692,8 +692,7 @@ export class CloudFilestoreManagerClient { * This value must start with a lowercase letter followed by up to 62 * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. * @param {google.cloud.filestore.v1beta1.Instance} request.instance - * Required. A [instance resource] - * (/cloud-filestore/reference/rest/v1beta1/projects.locations.instances) + * Required. An {@link google.cloud.filestore.v1beta1.Instance|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. @@ -988,16 +987,16 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The resource name of the instance, in the format - * projects/{project_id}/locations/{location_id}/instances/{instance_id}. + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. * @param {string} request.fileShare * Required. Name of the file share in the Cloud Filestore instance that the snapshot * is being restored to. * @param {string} request.sourceSnapshot * The resource name of the snapshot, in the format - * projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}. + * `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`. * @param {string} request.sourceBackup * The resource name of the backup, in the format - * projects/{project_id}/locations/{location_id}/backups/{backup_id}. + * `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1139,7 +1138,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The instance resource name, in the format - * projects/{project_id}/locations/{location}/instances/{instance_id} + * `projects/{project_id}/locations/{location}/instances/{instance_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1281,11 +1280,10 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The backup's project and location, in the format - * projects/{project_id}/locations/{location}. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, * backup locations map to GCP regions, for example **us-west1**. * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A [backup resource] - * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} * @param {string} request.backupId * Required. The ID to use for the backup. * The ID must be unique within the specified project and location. @@ -1433,7 +1431,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.name * Required. The backup resource name, in the format - * projects/{project_id}/locations/{location}/backups/{backup_id} + * `projects/{project_id}/locations/{location}/backups/{backup_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1574,8 +1572,7 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A [backup resource] - * (/cloud-filestore/reference/rest/v1beta1/projects.locations.backups) + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. At least one path must be supplied in this * field. @@ -1716,10 +1713,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1792,10 +1789,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1846,10 +1843,10 @@ export class CloudFilestoreManagerClient { * 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_id}/locations/{location}. In Cloud + * in the format `projects/{project_id}/locations/{location}`. In Cloud * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the {location} - * value. + * retrieve instance information for all locations, use "-" for the + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1935,11 +1932,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_id}/locations/{location}. + * in the format `projects/{project_id}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2012,11 +2009,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_id}/locations/{location}. + * in the format `projects/{project_id}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2067,11 +2064,11 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The project and location for which to retrieve backup information, - * in the format projects/{project_id}/locations/{location}. + * in the format `projects/{project_id}/locations/{location}`. * In Cloud Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the - * {location} value. + * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken From 4204551cddf9bbbdad1c074f9466f215154a4941 Mon Sep 17 00:00:00 2001 From: "F. Hinkelmann" Date: Wed, 4 Aug 2021 16:02:39 -0400 Subject: [PATCH 07/59] chore(nodejs): update client ref docs link in metadata (#9) --- packages/google-cloud-filestore/.repo-metadata.json | 4 ++-- packages/google-cloud-filestore/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index 8df22e00bef..57ab4cf56a5 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -2,7 +2,7 @@ "name": "filestore", "name_pretty": "Filestore", "product_documentation": "https://cloud.google.com/filestore/", - "client_documentation": "https://googleapis.dev/nodejs/filestore/latest", + "client_documentation": "https://cloud.google.com/nodejs/docs/reference/filestore/latest", "issue_tracker": "https://github.com/googleapis/nodejs-filestore/issues", "release_level": "ga", "language": "nodejs", @@ -11,4 +11,4 @@ "api_id": "file.googleapis.com", "default_version": "v1", "requires_billing": true -} \ No newline at end of file +} diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index 74b69a6ff2d..d1435e581d8 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -149,7 +149,7 @@ Apache Version 2.0 See [LICENSE](https://github.com/googleapis/nodejs-filestore/blob/master/LICENSE) -[client-docs]: https://googleapis.dev/nodejs/filestore/latest +[client-docs]: https://cloud.google.com/nodejs/docs/reference/filestore/latest [product-docs]: https://cloud.google.com/filestore/ [shell_img]: https://gstatic.com/cloudssh/images/open-btn.png [projects]: https://console.cloud.google.com/project From 9d8aa466632cd347dfc3291fea4842d3b65bc0c3 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Sat, 14 Aug 2021 00:43:51 -0700 Subject: [PATCH 08/59] fix(build): migrate to using main branch (#11) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): migrate to using main branch * 🦉 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-filestore/README.md | 16 ++++++++-------- .../google-cloud-filestore/samples/README.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index d1435e581d8..ae19d06f0f2 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -6,7 +6,7 @@ [![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/master.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) +[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) @@ -15,7 +15,7 @@ file client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-filestore/blob/master/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/nodejs-filestore/blob/main/CHANGELOG.md). * [Filestore Node.js Client API Reference][client-docs] * [Filestore Documentation][product-docs] @@ -82,11 +82,11 @@ listInstances(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-filestore/tree/master/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/nodejs-filestore/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-filestore/blob/master/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/nodejs-filestore/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-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | @@ -135,19 +135,19 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-filestore/blob/master/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-filestore/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) are generated from a central template. To edit one of these files, make an edit -to its template in this -[directory](https://github.com/googleapis/synthtool/tree/master/synthtool/gcp/templates/node_library). +to its templates in +[directory](https://github.com/googleapis/synthtool). ## License Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-filestore/blob/master/LICENSE) +See [LICENSE](https://github.com/googleapis/nodejs-filestore/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/filestore/latest [product-docs]: https://cloud.google.com/filestore/ diff --git a/packages/google-cloud-filestore/samples/README.md b/packages/google-cloud-filestore/samples/README.md index 37aedb225b6..272d9a920ad 100644 --- a/packages/google-cloud-filestore/samples/README.md +++ b/packages/google-cloud-filestore/samples/README.md @@ -31,7 +31,7 @@ Before running the samples, make sure you've followed the steps outlined in ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-filestore/blob/master/samples/quickstart.js). +View the [source code](https://github.com/googleapis/nodejs-filestore/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-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) From ca6c47338c60184229311af4a066652f274e1784 Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Mon, 16 Aug 2021 22:46:15 -0400 Subject: [PATCH 09/59] fix(deps): google-gax v2.24.1 (#13) --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 18f722f8a07..584269b60a2 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.19.0" + "google-gax": "^2.24.1" }, "devDependencies": { "@types/mocha": "^9.0.0", From a920cbcf1ef9987eed2fdc22433cbe5c06635735 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Tue, 17 Aug 2021 11:48:40 -0700 Subject: [PATCH 10/59] chore: release 1.0.1 (#12) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-filestore/CHANGELOG.md | 8 ++++++++ packages/google-cloud-filestore/package.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 2cc9f070376..9a4c92fc8ab 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +### [1.0.1](https://www.github.com/googleapis/nodejs-filestore/compare/v1.0.0...v1.0.1) (2021-08-17) + + +### Bug Fixes + +* **build:** migrate to using main branch ([#11](https://www.github.com/googleapis/nodejs-filestore/issues/11)) ([ce9e2eb](https://www.github.com/googleapis/nodejs-filestore/commit/ce9e2eb86e80b122d67f0b283597ba13e4b366ad)) +* **deps:** google-gax v2.24.1 ([#13](https://www.github.com/googleapis/nodejs-filestore/issues/13)) ([1a27c34](https://www.github.com/googleapis/nodejs-filestore/commit/1a27c34790099af5a5aa6e091b2c1207cc43d7da)) + ## 1.0.0 (2021-07-21) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 584269b60a2..005c0d9350f 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "1.0.0", + "version": "1.0.1", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index 969b99a11c9..35e2dac074e 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^1.0.0" + "@google-cloud/filestore": "^1.0.1" }, "devDependencies": { "c8": "^7.3.0", From 018f179d49310820b7189b70defc3d985d440018 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:28:37 +0000 Subject: [PATCH 11/59] feat: turns on self-signed JWT feature flag (#14) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 392067151 Source-Link: https://github.com/googleapis/googleapis/commit/06345f7b95c4b4a3ffe4303f1f2984ccc304b2e0 Source-Link: https://github.com/googleapis/googleapis-gen/commit/95882b37970e41e4cd51b22fa507cfd46dc7c4b6 --- .../src/v1/cloud_filestore_manager_client.ts | 7 +++++++ .../src/v1beta1/cloud_filestore_manager_client.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index cf06ed777f1..da64782683c 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -152,6 +152,12 @@ export class CloudFilestoreManagerClient { // 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; @@ -2234,6 +2240,7 @@ export class CloudFilestoreManagerClient { return this.cloudFilestoreManagerStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 6e15797a829..b6d2ae01ab2 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -155,6 +155,12 @@ export class CloudFilestoreManagerClient { // 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; @@ -2314,6 +2320,7 @@ export class CloudFilestoreManagerClient { return this.cloudFilestoreManagerStub!.then(stub => { this._terminated = true; stub.close(); + this.operationsClient.close(); }); } return Promise.resolve(); From f587cbc14a2c86c0632a80e0aa9a9793aec49fc2 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Mon, 23 Aug 2021 18:40:25 +0000 Subject: [PATCH 12/59] chore: release 1.1.0 (#15) :robot: I have created a release \*beep\* \*boop\* --- ## [1.1.0](https://www.github.com/googleapis/nodejs-filestore/compare/v1.0.1...v1.1.0) (2021-08-23) ### Features * turns on self-signed JWT feature flag ([#14](https://www.github.com/googleapis/nodejs-filestore/issues/14)) ([00c32a4](https://www.github.com/googleapis/nodejs-filestore/commit/00c32a4eaeaf6e4f19559a38e51d2b5ec23197b4)) --- 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-filestore/CHANGELOG.md | 7 +++++++ packages/google-cloud-filestore/package.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 9a4c92fc8ab..ba37e8131bb 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.0](https://www.github.com/googleapis/nodejs-filestore/compare/v1.0.1...v1.1.0) (2021-08-23) + + +### Features + +* turns on self-signed JWT feature flag ([#14](https://www.github.com/googleapis/nodejs-filestore/issues/14)) ([00c32a4](https://www.github.com/googleapis/nodejs-filestore/commit/00c32a4eaeaf6e4f19559a38e51d2b5ec23197b4)) + ### [1.0.1](https://www.github.com/googleapis/nodejs-filestore/compare/v1.0.0...v1.0.1) (2021-08-17) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 005c0d9350f..89e9ff57595 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "1.0.1", + "version": "1.1.0", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index 35e2dac074e..58daca62183 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^1.0.1" + "@google-cloud/filestore": "^1.1.0" }, "devDependencies": { "c8": "^7.3.0", From ee746bb383fb809273308c14e52802012be0dfc2 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 28 Sep 2021 16:58:13 -0700 Subject: [PATCH 13/59] docs(samples): add auto-generated samples for Node with api short name in region tag (#21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(samples): add auto-generated samples for Node with api short name in region tag PiperOrigin-RevId: 399287285 Source-Link: https://github.com/googleapis/googleapis/commit/15759865d1c54e3d46429010f7e472fe6c3d3715 Source-Link: https://github.com/googleapis/googleapis-gen/commit/b27fff623a5d8d586b703b5e4919856abe7c2eb3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYjI3ZmZmNjIzYTVkOGQ1ODZiNzAzYjVlNDkxOTg1NmFiZTdjMmViMyJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../cloud_filestore_manager.create_backup.js | 70 +++++++++++++++++ ...cloud_filestore_manager.create_instance.js | 66 ++++++++++++++++ .../cloud_filestore_manager.delete_backup.js | 54 +++++++++++++ ...cloud_filestore_manager.delete_instance.js | 54 +++++++++++++ .../v1/cloud_filestore_manager.get_backup.js | 53 +++++++++++++ .../cloud_filestore_manager.get_instance.js | 53 +++++++++++++ .../cloud_filestore_manager.list_backups.js | 76 ++++++++++++++++++ .../cloud_filestore_manager.list_instances.js | 75 ++++++++++++++++++ ...loud_filestore_manager.restore_instance.js | 65 ++++++++++++++++ .../cloud_filestore_manager.update_backup.js | 59 ++++++++++++++ ...cloud_filestore_manager.update_instance.js | 60 +++++++++++++++ .../cloud_filestore_manager.create_backup.js | 69 +++++++++++++++++ ...cloud_filestore_manager.create_instance.js | 69 +++++++++++++++++ .../cloud_filestore_manager.delete_backup.js | 55 +++++++++++++ ...cloud_filestore_manager.delete_instance.js | 55 +++++++++++++ .../cloud_filestore_manager.get_backup.js | 54 +++++++++++++ .../cloud_filestore_manager.get_instance.js | 54 +++++++++++++ .../cloud_filestore_manager.list_backups.js | 77 +++++++++++++++++++ .../cloud_filestore_manager.list_instances.js | 76 ++++++++++++++++++ ...loud_filestore_manager.restore_instance.js | 71 +++++++++++++++++ .../cloud_filestore_manager.update_backup.js | 60 +++++++++++++++ ...cloud_filestore_manager.update_instance.js | 64 +++++++++++++++ .../src/v1/cloud_filestore_manager_client.ts | 12 ++- .../v1beta1/cloud_filestore_manager_client.ts | 12 ++- 24 files changed, 1405 insertions(+), 8 deletions(-) create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js new file mode 100644 index 00000000000..7a1a69fdd38 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js @@ -0,0 +1,70 @@ +// 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, backup, backupId) { + // [START file_v1_generated_CloudFilestoreManager_CreateBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup's project and location, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + */ + // const parent = 'abc123' + /** + * Required. A [backup resource][google.cloud.filestore.v1.Backup] + */ + // const backup = '' + /** + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * Values that do not match this pattern will trigger an INVALID_ARGUMENT + * error. + */ + // const backupId = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function createBackup() { + // Construct request + const request = { + parent, + backup, + backupId, + }; + + // Run request + const [operation] = await filestoreClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + createBackup(); + // [END file_v1_generated_CloudFilestoreManager_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js new file mode 100644 index 00000000000..dd43756b59c --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js @@ -0,0 +1,66 @@ +// 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, instanceId, instance) { + // [START file_v1_generated_CloudFilestoreManager_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + */ + // const parent = 'abc123' + /** + * Required. The name of the instance to create. + * The name must be unique for the specified project and location. + */ + // const instanceId = 'abc123' + /** + * Required. An [instance resource][google.cloud.filestore.v1.Instance] + */ + // const instance = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function createInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await filestoreClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END file_v1_generated_CloudFilestoreManager_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js new file mode 100644 index 00000000000..13c03c1fa27 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.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(name) { + // [START file_v1_generated_CloudFilestoreManager_DeleteBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup resource name, in the format + * `projects/{project_number}/locations/{location}/backups/{backup_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function deleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteBackup(); + // [END file_v1_generated_CloudFilestoreManager_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js new file mode 100644 index 00000000000..51238106f26 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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(name) { + // [START file_v1_generated_CloudFilestoreManager_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function deleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END file_v1_generated_CloudFilestoreManager_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js new file mode 100644 index 00000000000..026f1c0181a --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.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(name) { + // [START file_v1_generated_CloudFilestoreManager_GetBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup resource name, in the format + * `projects/{project_number}/locations/{location}/backups/{backup_id}`. + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function getBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getBackup(request); + console.log(response); + } + + getBackup(); + // [END file_v1_generated_CloudFilestoreManager_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js new file mode 100644 index 00000000000..641baf39395 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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(name) { + // [START file_v1_generated_CloudFilestoreManager_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function getInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END file_v1_generated_CloudFilestoreManager_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js new file mode 100644 index 00000000000..7d46650df81 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -0,0 +1,76 @@ +// 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 file_v1_generated_CloudFilestoreManager_ListBackups_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup information, + * in the format `projects/{project_number}/locations/{location}`. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * `{location}` value. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function listBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listBackups(); + // [END file_v1_generated_CloudFilestoreManager_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js new file mode 100644 index 00000000000..9acc130205f --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -0,0 +1,75 @@ +// 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 file_v1_generated_CloudFilestoreManager_ListInstances_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_id}/locations/{location}`. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the + * `{location}` value. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function listInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END file_v1_generated_CloudFilestoreManager_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js new file mode 100644 index 00000000000..2e0d5d6a631 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -0,0 +1,65 @@ +// 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(name, fileShare) { + // [START file_v1_generated_CloudFilestoreManager_RestoreInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + */ + // const name = 'abc123' + /** + * Required. Name of the file share in the Cloud Filestore instance that the backup + * is being restored to. + */ + // const fileShare = 'abc123' + /** + * The resource name of the backup, in the format + * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. + */ + // const sourceBackup = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function restoreInstance() { + // Construct request + const request = { + name, + fileShare, + }; + + // Run request + const [operation] = await filestoreClient.restoreInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restoreInstance(); + // [END file_v1_generated_CloudFilestoreManager_RestoreInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js new file mode 100644 index 00000000000..2cef0029f51 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -0,0 +1,59 @@ +// 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(backup, updateMask) { + // [START file_v1_generated_CloudFilestoreManager_UpdateBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A [backup resource][google.cloud.filestore.v1.Backup] + */ + // const backup = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + */ + // const updateMask = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function updateBackup() { + // Construct request + const request = { + backup, + updateMask, + }; + + // Run request + const [operation] = await filestoreClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateBackup(); + // [END file_v1_generated_CloudFilestoreManager_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js new file mode 100644 index 00000000000..a98864bef31 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js @@ -0,0 +1,60 @@ +// 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 file_v1_generated_CloudFilestoreManager_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * * "description" + * * "file_shares" + * * "labels" + */ + // const updateMask = '' + /** + * Only fields specified in update_mask are updated. + */ + // const instance = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function updateInstance() { + // Construct request + const request = {}; + + // Run request + const [operation] = await filestoreClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END file_v1_generated_CloudFilestoreManager_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js new file mode 100644 index 00000000000..b7ee0cabfe7 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -0,0 +1,69 @@ +// 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, backup, backupId) { + // [START file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + */ + // const parent = 'abc123' + /** + * Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + */ + // const backup = '' + /** + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + */ + // const backupId = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function createBackup() { + // Construct request + const request = { + parent, + backup, + backupId, + }; + + // Run request + const [operation] = await filestoreClient.createBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + createBackup(); + // [END file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js new file mode 100644 index 00000000000..14c0c0ee218 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -0,0 +1,69 @@ +// 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, instanceId, instance) { + // [START file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + */ + // const parent = 'abc123' + /** + * Required. The ID of the instance to create. + * The ID must be unique within the specified project and location. + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + */ + // const instanceId = 'abc123' + /** + * Required. An [instance resource][google.cloud.filestore.v1beta1.Instance] + */ + // const instance = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function createInstance() { + // Construct request + const request = { + parent, + instanceId, + instance, + }; + + // Run request + const [operation] = await filestoreClient.createInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + createInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js new file mode 100644 index 00000000000..b3b269f9842 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.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 +// +// 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(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function deleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteBackup(); + // [END file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js new file mode 100644 index 00000000000..27fc57ebe04 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.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 +// +// 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(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function deleteInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + deleteInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js new file mode 100644 index 00000000000..ec284d7cbba --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.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(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_GetBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function getBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getBackup(request); + console.log(response); + } + + getBackup(); + // [END file_v1beta1_generated_CloudFilestoreManager_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js new file mode 100644 index 00000000000..2dc455400b2 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_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(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_GetInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function getInstance() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getInstance(request); + console.log(response); + } + + getInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_GetInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js new file mode 100644 index 00000000000..3ff8de2be72 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -0,0 +1,77 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +'use strict'; + +function main(parent) { + // [START file_v1beta1_generated_CloudFilestoreManager_ListBackups_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup information, + * in the format `projects/{project_id}/locations/{location}`. + * In Cloud Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * `{location}` value. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function listBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listBackups(); + // [END file_v1beta1_generated_CloudFilestoreManager_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js new file mode 100644 index 00000000000..2e489645f52 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js @@ -0,0 +1,76 @@ +// 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 file_v1beta1_generated_CloudFilestoreManager_ListInstances_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_id}/locations/{location}`. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the + * `{location}` value. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function listInstances() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listInstancesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + listInstances(); + // [END file_v1beta1_generated_CloudFilestoreManager_ListInstances_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js new file mode 100644 index 00000000000..c6e7fec7663 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.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(name, fileShare) { + // [START file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The resource name of the instance, in the format + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. + */ + // const name = 'abc123' + /** + * Required. Name of the file share in the Cloud Filestore instance that the snapshot + * is being restored to. + */ + // const fileShare = 'abc123' + /** + * The resource name of the snapshot, in the format + * `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`. + */ + // const sourceSnapshot = 'abc123' + /** + * The resource name of the backup, in the format + * `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. + */ + // const sourceBackup = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function restoreInstance() { + // Construct request + const request = { + name, + fileShare, + }; + + // Run request + const [operation] = await filestoreClient.restoreInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + restoreInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js new file mode 100644 index 00000000000..db9bed19831 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js @@ -0,0 +1,60 @@ +// 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(backup, updateMask) { + // [START file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + */ + // const backup = '' + /** + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + */ + // const updateMask = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function updateBackup() { + // Construct request + const request = { + backup, + updateMask, + }; + + // Run request + const [operation] = await filestoreClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateBackup(); + // [END file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js new file mode 100644 index 00000000000..f87fc64e0ad --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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(updateMask, instance) { + // [START file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async] + /** + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * * "description" + * * "file_shares" + * * "labels" + */ + // const updateMask = '' + /** + * Required. Only fields specified in update_mask are updated. + */ + // const instance = '' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = + require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function updateInstance() { + // Construct request + const request = { + updateMask, + instance, + }; + + // Run request + const [operation] = await filestoreClient.updateInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + updateInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index da64782683c..9838ca9734c 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -1807,7 +1807,8 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as gax.GaxCall, @@ -1866,7 +1867,8 @@ export class CloudFilestoreManagerClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, @@ -2022,7 +2024,8 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.createStream( this.innerApiCalls.listBackups as gax.GaxCall, @@ -2082,7 +2085,8 @@ export class CloudFilestoreManagerClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index b6d2ae01ab2..528cf8af981 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -1832,7 +1832,8 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.createStream( this.innerApiCalls.listInstances as gax.GaxCall, @@ -1891,7 +1892,8 @@ export class CloudFilestoreManagerClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listInstances']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, @@ -2053,7 +2055,8 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.createStream( this.innerApiCalls.listBackups as gax.GaxCall, @@ -2113,7 +2116,8 @@ export class CloudFilestoreManagerClient { parent: request.parent || '', }); options = options || {}; - const callSettings = new gax.CallSettings(options); + const defaultCallSettings = this._defaults['listBackups']; + const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, From b53c8c96ef50178b4c9a658c400801a10dbd8eae Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Oct 2021 16:01:45 -0700 Subject: [PATCH 14/59] fix(filestore): add missing operation_metadata.proto import (#24) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(filestore): add missing operation_metadata.proto import PiperOrigin-RevId: 399764091 Source-Link: https://github.com/googleapis/googleapis/commit/5e5a44d76cc56260485acd4ba0ef002e2b4489f9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/e0dd43a5052549e69e8e7a29c67efd3a4f88a0df Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZTBkZDQzYTUwNTI1NDllNjllOGU3YTI5YzY3ZWZkM2E0Zjg4YTBkZiJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: sofisl <55454395+sofisl@users.noreply.github.com> --- .../v1/cloud_filestore_service.proto | 110 +++++++++--------- .../cloud_filestore_manager.list_backups.js | 10 +- .../cloud_filestore_manager.list_instances.js | 6 +- ...loud_filestore_manager.restore_instance.js | 4 +- .../cloud_filestore_manager.update_backup.js | 4 +- .../src/v1/cloud_filestore_manager_client.ts | 56 ++++----- 6 files changed, 96 insertions(+), 94 deletions(-) diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto index 3afd7e45084..676fa0b2fc5 100644 --- a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1/cloud_filestore_service.proto @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/common/operation_metadata.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -53,7 +54,8 @@ option php_namespace = "Google\\Cloud\\Filestore\\V1"; // * `projects/12345/locations/us-central1/backups/my-backup` service CloudFilestoreManager { option (google.api.default_host) = "file.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 all instances in a project for either a specified location // or for all locations. @@ -76,7 +78,8 @@ service CloudFilestoreManager { // When creating from a backup, the capacity of the new instance needs to be // equal to or larger than the capacity of the backup (and also equal to or // larger than the minimum capacity of the tier). - 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" @@ -89,7 +92,8 @@ service CloudFilestoreManager { } // Updates the settings of a specific 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,7 +110,8 @@ service CloudFilestoreManager { // The capacity of the instance needs to be equal to or larger than the // capacity of the backup (and also equal to or larger than the minimum // capacity of the tier). - rpc RestoreInstance(RestoreInstanceRequest) returns (google.longrunning.Operation) { + rpc RestoreInstance(RestoreInstanceRequest) + returns (google.longrunning.Operation) { option (google.api.http) = { post: "/v1/{name=projects/*/locations/*/instances/*}:restore" body: "*" @@ -118,7 +123,8 @@ service CloudFilestoreManager { } // Deletes an 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/*}" }; @@ -236,9 +242,9 @@ message FileShareConfig { // The resource name of the backup, in the format // `projects/{project_number}/locations/{location_id}/backups/{backup_id}`, // that this file share has been restored from. - string source_backup = 8 [(google.api.resource_reference) = { - type: "file.googleapis.com/Backup" - }]; + string source_backup = 8 [ + (google.api.resource_reference) = { type: "file.googleapis.com/Backup" } + ]; } // Nfs Export Options. @@ -380,7 +386,8 @@ message Instance { string status_message = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time when the instance was created. - google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; // The service tier of the instance. Tier tier = 8; @@ -401,7 +408,8 @@ message Instance { string etag = 12; // Output only. Reserved for future use. - google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.BoolValue satisfies_pzs = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // CreateInstanceRequest creates an instance. @@ -430,9 +438,7 @@ message GetInstanceRequest { // `projects/{project_id}/locations/{location}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "file.googleapis.com/Instance" - } + (google.api.resource_reference) = { type: "file.googleapis.com/Instance" } ]; } @@ -458,21 +464,19 @@ message RestoreInstanceRequest { // `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "file.googleapis.com/Instance" - } + (google.api.resource_reference) = { type: "file.googleapis.com/Instance" } ]; - // Required. Name of the file share in the Cloud Filestore instance that the backup - // is being restored to. + // Required. Name of the file share in the Cloud Filestore instance that the + // backup is being restored to. string file_share = 2 [(google.api.field_behavior) = REQUIRED]; oneof source { // The resource name of the backup, in the format // `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. - string source_backup = 3 [(google.api.resource_reference) = { - type: "file.googleapis.com/Backup" - }]; + string source_backup = 3 [ + (google.api.resource_reference) = { type: "file.googleapis.com/Backup" } + ]; } } @@ -482,17 +486,15 @@ message DeleteInstanceRequest { // `projects/{project_id}/locations/{location}/instances/{instance_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "file.googleapis.com/Instance" - } + (google.api.resource_reference) = { type: "file.googleapis.com/Instance" } ]; } // ListInstancesRequest lists instances. message ListInstancesRequest { - // Required. The project and location for which to retrieve instance information, - // in the format `projects/{project_id}/locations/{location}`. In Cloud - // Filestore, locations map to GCP zones, for example **us-west1-b**. To + // Required. The project and location for which to retrieve instance + // information, in the format `projects/{project_id}/locations/{location}`. In + // Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To // retrieve instance information for all locations, use "-" for the // `{location}` value. string parent = 1 [ @@ -572,7 +574,8 @@ message Backup { State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. The time when the backup was created. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; // Resource labels to represent user provided metadata. map labels = 5; @@ -580,32 +583,34 @@ message Backup { // Output only. Capacity of the source file share when the backup was created. int64 capacity_gb = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. The size of the storage used by the backup. As backups share storage, - // this number is expected to change with backup creation/deletion. + // Output only. The size of the storage used by the backup. As backups share + // storage, this number is expected to change with backup creation/deletion. int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; // The resource name of the source Cloud Filestore instance, in the format // `projects/{project_number}/locations/{location_id}/instances/{instance_id}`, // used to create this backup. - string source_instance = 8 [(google.api.resource_reference) = { - type: "file.googleapis.com/Instance" - }]; + string source_instance = 8 [ + (google.api.resource_reference) = { type: "file.googleapis.com/Instance" } + ]; // Name of the file share in the source Cloud Filestore instance that the // backup is created from. string source_file_share = 9; - // Output only. The service tier of the source Cloud Filestore instance that this backup - // is created from. - Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + // Output only. The service tier of the source Cloud Filestore instance that + // this backup is created from. + Instance.Tier source_instance_tier = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; - // Output only. Amount of bytes that will be downloaded if the backup is restored. This - // may be different than storage bytes, since sequential backups of the same - // disk will share storage. + // Output only. Amount of bytes that will be downloaded if the backup is + // restored. This may be different than storage bytes, since sequential + // backups of the same disk will share storage. int64 download_bytes = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; // Output only. Reserved for future use. - google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + google.protobuf.BoolValue satisfies_pzs = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; } // CreateBackupRequest creates a backup. @@ -639,9 +644,7 @@ message DeleteBackupRequest { // `projects/{project_number}/locations/{location}/backups/{backup_id}` string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "file.googleapis.com/Backup" - } + (google.api.resource_reference) = { type: "file.googleapis.com/Backup" } ]; } @@ -650,9 +653,10 @@ message UpdateBackupRequest { // Required. A [backup resource][google.cloud.filestore.v1.Backup] Backup backup = 1 [(google.api.field_behavior) = REQUIRED]; - // Required. Mask of fields to update. At least one path must be supplied in this - // field. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; + // Required. Mask of fields to update. At least one path must be supplied in + // this field. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; } // GetBackupRequest gets the state of a backup. @@ -661,19 +665,17 @@ message GetBackupRequest { // `projects/{project_number}/locations/{location}/backups/{backup_id}`. string name = 1 [ (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "file.googleapis.com/Backup" - } + (google.api.resource_reference) = { type: "file.googleapis.com/Backup" } ]; } // ListBackupsRequest lists backups. message ListBackupsRequest { - // Required. The project and location for which to retrieve backup information, - // in the format `projects/{project_number}/locations/{location}`. - // In Cloud Filestore, backup locations map to GCP regions, - // for example **us-west1**. - // To retrieve backup information for all locations, use "-" for the + // Required. The project and location for which to retrieve backup + // information, in the format + // `projects/{project_number}/locations/{location}`. In Cloud Filestore, + // backup locations map to GCP regions, for example **us-west1**. To retrieve + // backup information for all locations, use "-" for the // `{location}` value. string parent = 1 [ (google.api.field_behavior) = REQUIRED, diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index 7d46650df81..9573833d561 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -20,11 +20,11 @@ function main(parent) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_number}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup + * information, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. To retrieve + * backup information for all locations, use "-" for the * `{location}` value. */ // const parent = 'abc123' diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 9acc130205f..34e9dcf6fd7 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -20,9 +20,9 @@ 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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To * retrieve instance information for all locations, use "-" for the * `{location}` value. */ diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index 2e0d5d6a631..31cd209e802 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -25,8 +25,8 @@ function main(name, fileShare) { */ // const name = 'abc123' /** - * Required. Name of the file share in the Cloud Filestore instance that the backup - * is being restored to. + * Required. Name of the file share in the Cloud Filestore instance that the + * backup is being restored to. */ // const fileShare = 'abc123' /** diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 2cef0029f51..4c568503a41 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -24,8 +24,8 @@ function main(backup, updateMask) { */ // const backup = '' /** - * Required. Mask of fields to update. At least one path must be supplied in this - * field. + * Required. Mask of fields to update. At least one path must be supplied in + * this field. */ // const updateMask = '' diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 9838ca9734c..113c139a8cd 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -971,8 +971,8 @@ export class CloudFilestoreManagerClient { * Required. The resource name of the instance, in the format * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. * @param {string} request.fileShare - * Required. Name of the file share in the Cloud Filestore instance that the backup - * is being restored to. + * Required. Name of the file share in the Cloud Filestore instance that the + * backup is being restored to. * @param {string} request.sourceBackup * The resource name of the backup, in the format * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. @@ -1555,8 +1555,8 @@ export class CloudFilestoreManagerClient { * @param {google.cloud.filestore.v1.Backup} request.backup * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. At least one path must be supplied in this - * field. + * Required. Mask of fields to update. At least one path must be supplied in + * this field. * @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. @@ -1693,9 +1693,9 @@ export class CloudFilestoreManagerClient { * @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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To * retrieve instance information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize @@ -1769,9 +1769,9 @@ export class CloudFilestoreManagerClient { * @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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To * retrieve instance information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize @@ -1824,9 +1824,9 @@ export class CloudFilestoreManagerClient { * @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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * Required. The project and location for which to retrieve instance + * information, in the format `projects/{project_id}/locations/{location}`. In + * Cloud Filestore, locations map to GCP zones, for example **us-west1-b**. To * retrieve instance information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize @@ -1910,11 +1910,11 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_number}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup + * information, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. To retrieve + * backup information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. @@ -1985,11 +1985,11 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_number}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup + * information, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. To retrieve + * backup information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. @@ -2041,11 +2041,11 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_number}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup + * information, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. To retrieve + * backup information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. From 996f5da9bcabd4d395ffd93c527b770b02bb55dc 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 00:48:31 +0000 Subject: [PATCH 15/59] build(node): update deps used during postprocessing (#1243) (#26) --- .../google-cloud-filestore/protos/protos.d.ts | 3 ++- packages/google-cloud-filestore/protos/protos.js | 7 +++++++ .../google-cloud-filestore/protos/protos.json | 15 ++++++++++++++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index 01c10c4a824..9e26b9dc5ce 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/protos/protos.d.ts @@ -4678,7 +4678,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 Http. */ diff --git a/packages/google-cloud-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index fbd8fd3d693..1afb2a91547 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/protos/protos.js @@ -11757,6 +11757,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); @@ -11767,6 +11768,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; })(); @@ -18839,6 +18841,7 @@ case 4: case 5: case 6: + case 7: break; } } @@ -18943,6 +18946,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-filestore/protos/protos.json b/packages/google-cloud-filestore/protos/protos.json index 18136930a80..23403a77892 100644 --- a/packages/google-cloud-filestore/protos/protos.json +++ b/packages/google-cloud-filestore/protos/protos.json @@ -1768,7 +1768,8 @@ "OUTPUT_ONLY": 3, "INPUT_ONLY": 4, "IMMUTABLE": 5, - "UNORDERED_LIST": 6 + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7 } }, "http": { @@ -2514,6 +2515,18 @@ ] ], "reserved": [ + [ + 4, + 4 + ], + [ + 5, + 5 + ], + [ + 6, + 6 + ], [ 8, 8 From 651518b513f093f79b6a06495578a5ff916347de Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 14 Oct 2021 01:16:17 +0000 Subject: [PATCH 16/59] chore: release 1.1.1 (#25) :robot: I have created a release \*beep\* \*boop\* --- ### [1.1.1](https://www.github.com/googleapis/nodejs-filestore/compare/v1.1.0...v1.1.1) (2021-10-14) ### Bug Fixes * **filestore:** add missing operation_metadata.proto import ([#24](https://www.github.com/googleapis/nodejs-filestore/issues/24)) ([58f6bd0](https://www.github.com/googleapis/nodejs-filestore/commit/58f6bd08080f79e8b60967f27990783660b0f1be)) --- 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-filestore/CHANGELOG.md | 7 +++++++ packages/google-cloud-filestore/package.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index ba37e8131bb..006d2983327 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.1](https://www.github.com/googleapis/nodejs-filestore/compare/v1.1.0...v1.1.1) (2021-10-14) + + +### Bug Fixes + +* **filestore:** add missing operation_metadata.proto import ([#24](https://www.github.com/googleapis/nodejs-filestore/issues/24)) ([58f6bd0](https://www.github.com/googleapis/nodejs-filestore/commit/58f6bd08080f79e8b60967f27990783660b0f1be)) + ## [1.1.0](https://www.github.com/googleapis/nodejs-filestore/compare/v1.0.1...v1.1.0) (2021-08-23) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 89e9ff57595..e0b37f9a21a 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "1.1.0", + "version": "1.1.1", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index 58daca62183..76e5b893c39 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^1.1.0" + "@google-cloud/filestore": "^1.1.1" }, "devDependencies": { "c8": "^7.3.0", From 1a7cd425b913b486bff68e0531f02e070da33611 Mon Sep 17 00:00:00 2001 From: Takashi Matsuo Date: Wed, 27 Oct 2021 11:24:44 -0700 Subject: [PATCH 17/59] chore: fix the wrong post processor image (#28) --- packages/google-cloud-filestore/.github/.OwlBot.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/.github/.OwlBot.yaml b/packages/google-cloud-filestore/.github/.OwlBot.yaml index a147b06c66b..e917fee3c4c 100644 --- a/packages/google-cloud-filestore/.github/.OwlBot.yaml +++ b/packages/google-cloud-filestore/.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 e9800137dc29335e2d2d7f3d1969ffdef7bba219 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 27 Oct 2021 21:44:20 +0200 Subject: [PATCH 18/59] chore(deps): update dependency @types/node to v16 (#27) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index e0b37f9a21a..69912dfa44a 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 33247bd27ddb166a086c72b436704ca64ed8d9d7 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 4 Nov 2021 20:44:22 +0100 Subject: [PATCH 19/59] chore(deps): update dependency sinon to v12 (#29) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 69912dfa44a..5fc206773a6 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 f8ff063e37afa57016d5d390257e4d1d1ab39eb7 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:58 -0800 Subject: [PATCH 20/59] docs(samples): add example tags to generated samples (#30) 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 | 2 +- .../cloud_filestore_manager.create_backup.js | 8 +- ...cloud_filestore_manager.create_instance.js | 8 +- .../cloud_filestore_manager.delete_backup.js | 4 +- ...cloud_filestore_manager.delete_instance.js | 4 +- .../v1/cloud_filestore_manager.get_backup.js | 4 +- .../cloud_filestore_manager.get_instance.js | 4 +- .../cloud_filestore_manager.list_backups.js | 4 +- .../cloud_filestore_manager.list_instances.js | 4 +- ...loud_filestore_manager.restore_instance.js | 4 +- .../cloud_filestore_manager.update_backup.js | 10 +- ...cloud_filestore_manager.update_instance.js | 8 +- .../cloud_filestore_manager.create_backup.js | 8 +- ...cloud_filestore_manager.create_instance.js | 8 +- .../cloud_filestore_manager.delete_backup.js | 4 +- ...cloud_filestore_manager.delete_instance.js | 4 +- .../cloud_filestore_manager.get_backup.js | 4 +- .../cloud_filestore_manager.get_instance.js | 4 +- .../cloud_filestore_manager.list_backups.js | 4 +- .../cloud_filestore_manager.list_instances.js | 4 +- ...loud_filestore_manager.restore_instance.js | 4 +- .../cloud_filestore_manager.update_backup.js | 10 +- ...cloud_filestore_manager.update_instance.js | 8 +- .../src/v1/cloud_filestore_manager_client.ts | 618 ++++++++--------- .../v1beta1/cloud_filestore_manager_client.ts | 634 +++++++++--------- 25 files changed, 653 insertions(+), 725 deletions(-) diff --git a/packages/google-cloud-filestore/linkinator.config.json b/packages/google-cloud-filestore/linkinator.config.json index 29a223b6db6..0121dfa684f 100644 --- a/packages/google-cloud-filestore/linkinator.config.json +++ b/packages/google-cloud-filestore/linkinator.config.json @@ -6,5 +6,5 @@ "img.shields.io" ], "silent": true, - "concurrency": 10 + "concurrency": 5 } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js index 7a1a69fdd38..939befb1c6e 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js @@ -26,9 +26,9 @@ function main(parent, backup, backupId) { */ // const parent = 'abc123' /** - * Required. A [backup resource][google.cloud.filestore.v1.Backup] + * Required. A backup resource google.cloud.filestore.v1.Backup */ - // const backup = '' + // const backup = {} /** * Required. The ID to use for the backup. * The ID must be unique within the specified project and location. @@ -45,7 +45,7 @@ function main(parent, backup, backupId) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function createBackup() { + async function callCreateBackup() { // Construct request const request = { parent, @@ -59,7 +59,7 @@ function main(parent, backup, backupId) { console.log(response); } - createBackup(); + callCreateBackup(); // [END file_v1_generated_CloudFilestoreManager_CreateBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js index dd43756b59c..5aff786f26f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js @@ -31,9 +31,9 @@ function main(parent, instanceId, instance) { */ // const instanceId = 'abc123' /** - * Required. An [instance resource][google.cloud.filestore.v1.Instance] + * Required. An instance resource google.cloud.filestore.v1.Instance */ - // const instance = '' + // const instance = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; @@ -41,7 +41,7 @@ function main(parent, instanceId, instance) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function createInstance() { + async function callCreateInstance() { // Construct request const request = { parent, @@ -55,7 +55,7 @@ function main(parent, instanceId, instance) { console.log(response); } - createInstance(); + callCreateInstance(); // [END file_v1_generated_CloudFilestoreManager_CreateInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js index 13c03c1fa27..59c13d4d9a6 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function deleteBackup() { + async function callDeleteBackup() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteBackup(); + callDeleteBackup(); // [END file_v1_generated_CloudFilestoreManager_DeleteBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js index 51238106f26..352744e15d3 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function deleteInstance() { + async function callDeleteInstance() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - deleteInstance(); + callDeleteInstance(); // [END file_v1_generated_CloudFilestoreManager_DeleteInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js index 026f1c0181a..7053baf6c49 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function getBackup() { + async function callGetBackup() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getBackup(); + callGetBackup(); // [END file_v1_generated_CloudFilestoreManager_GetBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js index 641baf39395..0271cb59cbe 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js @@ -31,7 +31,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function getInstance() { + async function callGetInstance() { // Construct request const request = { name, @@ -42,7 +42,7 @@ function main(name) { console.log(response); } - getInstance(); + callGetInstance(); // [END file_v1_generated_CloudFilestoreManager_GetInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index 9573833d561..f67c239fdb3 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -52,7 +52,7 @@ function main(parent) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function listBackups() { + async function callListBackups() { // Construct request const request = { parent, @@ -65,7 +65,7 @@ function main(parent) { } } - listBackups(); + callListBackups(); // [END file_v1_generated_CloudFilestoreManager_ListBackups_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 34e9dcf6fd7..52b67e24501 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -51,7 +51,7 @@ function main(parent) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function listInstances() { + async function callListInstances() { // Construct request const request = { parent, @@ -64,7 +64,7 @@ function main(parent) { } } - listInstances(); + callListInstances(); // [END file_v1_generated_CloudFilestoreManager_ListInstances_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index 31cd209e802..b9a405f702a 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -41,7 +41,7 @@ function main(name, fileShare) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function restoreInstance() { + async function callRestoreInstance() { // Construct request const request = { name, @@ -54,7 +54,7 @@ function main(name, fileShare) { console.log(response); } - restoreInstance(); + callRestoreInstance(); // [END file_v1_generated_CloudFilestoreManager_RestoreInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 4c568503a41..29b33890384 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -20,14 +20,14 @@ function main(backup, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A [backup resource][google.cloud.filestore.v1.Backup] + * Required. A backup resource google.cloud.filestore.v1.Backup */ - // const backup = '' + // const backup = {} /** * Required. Mask of fields to update. At least one path must be supplied in * this field. */ - // const updateMask = '' + // const updateMask = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; @@ -35,7 +35,7 @@ function main(backup, updateMask) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function updateBackup() { + async function callUpdateBackup() { // Construct request const request = { backup, @@ -48,7 +48,7 @@ function main(backup, updateMask) { console.log(response); } - updateBackup(); + callUpdateBackup(); // [END file_v1_generated_CloudFilestoreManager_UpdateBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js index a98864bef31..d5a4d96af69 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js @@ -27,11 +27,11 @@ function main() { * * "file_shares" * * "labels" */ - // const updateMask = '' + // const updateMask = {} /** * Only fields specified in update_mask are updated. */ - // const instance = '' + // const instance = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1; @@ -39,7 +39,7 @@ function main() { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function updateInstance() { + async function callUpdateInstance() { // Construct request const request = {}; @@ -49,7 +49,7 @@ function main() { console.log(response); } - updateInstance(); + callUpdateInstance(); // [END file_v1_generated_CloudFilestoreManager_UpdateInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index b7ee0cabfe7..38fcd949ec6 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -26,9 +26,9 @@ function main(parent, backup, backupId) { */ // const parent = 'abc123' /** - * Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + * Required. A backup resource google.cloud.filestore.v1beta1.Backup */ - // const backup = '' + // const backup = {} /** * Required. The ID to use for the backup. * The ID must be unique within the specified project and location. @@ -44,7 +44,7 @@ function main(parent, backup, backupId) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function createBackup() { + async function callCreateBackup() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent, backup, backupId) { console.log(response); } - createBackup(); + callCreateBackup(); // [END file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index 14c0c0ee218..3ea5039f538 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -33,9 +33,9 @@ function main(parent, instanceId, instance) { */ // const instanceId = 'abc123' /** - * Required. An [instance resource][google.cloud.filestore.v1beta1.Instance] + * Required. An instance resource google.cloud.filestore.v1beta1.Instance */ - // const instance = '' + // const instance = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = @@ -44,7 +44,7 @@ function main(parent, instanceId, instance) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function createInstance() { + async function callCreateInstance() { // Construct request const request = { parent, @@ -58,7 +58,7 @@ function main(parent, instanceId, instance) { console.log(response); } - createInstance(); + callCreateInstance(); // [END file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js index b3b269f9842..8b01eb81ff3 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function deleteBackup() { + async function callDeleteBackup() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteBackup(); + callDeleteBackup(); // [END file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index 27fc57ebe04..6c9ca8572a8 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function deleteInstance() { + async function callDeleteInstance() { // Construct request const request = { name, @@ -44,7 +44,7 @@ function main(name) { console.log(response); } - deleteInstance(); + callDeleteInstance(); // [END file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js index ec284d7cbba..49201a3d98f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function getBackup() { + async function callGetBackup() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getBackup(); + callGetBackup(); // [END file_v1beta1_generated_CloudFilestoreManager_GetBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js index 2dc455400b2..7cb923b91d2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js @@ -32,7 +32,7 @@ function main(name) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function getInstance() { + async function callGetInstance() { // Construct request const request = { name, @@ -43,7 +43,7 @@ function main(name) { console.log(response); } - getInstance(); + callGetInstance(); // [END file_v1beta1_generated_CloudFilestoreManager_GetInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 3ff8de2be72..647c4a28d46 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -53,7 +53,7 @@ function main(parent) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function listBackups() { + async function callListBackups() { // Construct request const request = { parent, @@ -66,7 +66,7 @@ function main(parent) { } } - listBackups(); + callListBackups(); // [END file_v1beta1_generated_CloudFilestoreManager_ListBackups_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js index 2e489645f52..5367bab35a2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js @@ -52,7 +52,7 @@ function main(parent) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function listInstances() { + async function callListInstances() { // Construct request const request = { parent, @@ -65,7 +65,7 @@ function main(parent) { } } - listInstances(); + callListInstances(); // [END file_v1beta1_generated_CloudFilestoreManager_ListInstances_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index c6e7fec7663..360e9569f27 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js @@ -47,7 +47,7 @@ function main(name, fileShare) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function restoreInstance() { + async function callRestoreInstance() { // Construct request const request = { name, @@ -60,7 +60,7 @@ function main(name, fileShare) { console.log(response); } - restoreInstance(); + callRestoreInstance(); // [END file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js index db9bed19831..9b53ba023b8 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js @@ -20,14 +20,14 @@ function main(backup, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A [backup resource][google.cloud.filestore.v1beta1.Backup] + * Required. A backup resource google.cloud.filestore.v1beta1.Backup */ - // const backup = '' + // const backup = {} /** * Required. Mask of fields to update. At least one path must be supplied in this * field. */ - // const updateMask = '' + // const updateMask = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = @@ -36,7 +36,7 @@ function main(backup, updateMask) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function updateBackup() { + async function callUpdateBackup() { // Construct request const request = { backup, @@ -49,7 +49,7 @@ function main(backup, updateMask) { console.log(response); } - updateBackup(); + callUpdateBackup(); // [END file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async] } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js index f87fc64e0ad..66a7190fe10 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js @@ -27,11 +27,11 @@ function main(updateMask, instance) { * * "file_shares" * * "labels" */ - // const updateMask = '' + // const updateMask = {} /** * Required. Only fields specified in update_mask are updated. */ - // const instance = '' + // const instance = {} // Imports the Filestore library const {CloudFilestoreManagerClient} = @@ -40,7 +40,7 @@ function main(updateMask, instance) { // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); - async function updateInstance() { + async function callUpdateInstance() { // Construct request const request = { updateMask, @@ -53,7 +53,7 @@ function main(updateMask, instance) { console.log(response); } - updateInstance(); + callUpdateInstance(); // [END file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async] } diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 113c139a8cd..7255c1ec2b5 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -451,6 +451,24 @@ export class CloudFilestoreManagerClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets the details of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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/cloud_filestore_manager.get_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_GetInstance_async + */ getInstance( request?: protos.google.cloud.filestore.v1.IGetInstanceRequest, options?: CallOptions @@ -478,24 +496,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Gets the details of a specific instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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.filestore.v1.IGetInstanceRequest, optionsOrCallback?: @@ -537,6 +537,24 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Gets the details of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * `projects/{project_number}/locations/{location}/backups/{backup_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1.Backup}. + * 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/cloud_filestore_manager.get_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_GetBackup_async + */ getBackup( request?: protos.google.cloud.filestore.v1.IGetBackupRequest, options?: CallOptions @@ -564,24 +582,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Gets the details of a specific backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The backup resource name, in the format - * `projects/{project_number}/locations/{location}/backups/{backup_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1.Backup}. - * 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.getBackup(request); - */ getBackup( request?: protos.google.cloud.filestore.v1.IGetBackupRequest, optionsOrCallback?: @@ -622,6 +622,35 @@ export class CloudFilestoreManagerClient { return this.innerApiCalls.getBackup(request, options, callback); } + /** + * Creates an instance. + * When creating from a backup, the capacity of the new instance needs to be + * equal to or larger than the capacity of the backup (and also equal to or + * larger than the minimum capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + * @param {string} request.instanceId + * Required. The name of the instance to create. + * The name must be unique for the specified project and location. + * @param {google.cloud.filestore.v1.Instance} request.instance + * Required. An {@link google.cloud.filestore.v1.Instance|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/cloud_filestore_manager.create_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_CreateInstance_async + */ createInstance( request?: protos.google.cloud.filestore.v1.ICreateInstanceRequest, options?: CallOptions @@ -658,36 +687,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Creates an instance. - * When creating from a backup, the capacity of the new instance needs to be - * equal to or larger than the capacity of the backup (and also equal to or - * larger than the minimum capacity of the tier). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, - * locations map to GCP zones, for example **us-west1-b**. - * @param {string} request.instanceId - * Required. The name of the instance to create. - * The name must be unique for the specified project and location. - * @param {google.cloud.filestore.v1.Instance} request.instance - * Required. An {@link google.cloud.filestore.v1.Instance|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.filestore.v1.ICreateInstanceRequest, optionsOrCallback?: @@ -745,11 +744,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.create_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -773,6 +769,33 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Updates the settings of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * + * * "description" + * * "file_shares" + * * "labels" + * @param {google.cloud.filestore.v1.Instance} request.instance + * Only fields specified in update_mask are updated. + * @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/cloud_filestore_manager.update_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.filestore.v1.IUpdateInstanceRequest, options?: CallOptions @@ -809,34 +832,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Updates the settings of a specific instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Mask of fields to update. At least one path must be supplied in this - * field. The elements of the repeated paths field may only include these - * fields: - * - * * "description" - * * "file_shares" - * * "labels" - * @param {google.cloud.filestore.v1.Instance} request.instance - * Only fields specified in update_mask are updated. - * @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.filestore.v1.IUpdateInstanceRequest, optionsOrCallback?: @@ -894,11 +889,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.update_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -922,6 +914,36 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Restores an existing instance's file share from a backup. + * + * The capacity of the instance needs to be equal to or larger than the + * capacity of the backup (and also equal to or larger than the minimum + * capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the instance, in the format + * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. + * @param {string} request.fileShare + * Required. Name of the file share in the Cloud Filestore instance that the + * backup is being restored to. + * @param {string} request.sourceBackup + * The resource name of the backup, in the format + * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_filestore_manager.restore_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_RestoreInstance_async + */ restoreInstance( request?: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, options?: CallOptions @@ -958,37 +980,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Restores an existing instance's file share from a backup. - * - * The capacity of the instance needs to be equal to or larger than the - * capacity of the backup (and also equal to or larger than the minimum - * capacity of the tier). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the instance, in the format - * `projects/{project_number}/locations/{location_id}/instances/{instance_id}`. - * @param {string} request.fileShare - * Required. Name of the file share in the Cloud Filestore instance that the - * backup is being restored to. - * @param {string} request.sourceBackup - * The resource name of the backup, in the format - * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.restoreInstance(request); - * const [response] = await operation.promise(); - */ restoreInstance( request?: protos.google.cloud.filestore.v1.IRestoreInstanceRequest, optionsOrCallback?: @@ -1046,11 +1037,8 @@ export class CloudFilestoreManagerClient { * 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 checkRestoreInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_filestore_manager.restore_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_RestoreInstance_async */ async checkRestoreInstanceProgress( name: string @@ -1074,6 +1062,26 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Deletes an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, options?: CallOptions @@ -1110,27 +1118,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Deletes an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ deleteInstance( request?: protos.google.cloud.filestore.v1.IDeleteInstanceRequest, optionsOrCallback?: @@ -1188,11 +1175,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1_generated_CloudFilestoreManager_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -1216,6 +1200,37 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Creates a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup's project and location, in the format + * `projects/{project_number}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + * @param {google.cloud.filestore.v1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} + * @param {string} request.backupId + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * Values that do not match this pattern will trigger an INVALID_ARGUMENT + * error. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_filestore_manager.create_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_CreateBackup_async + */ createBackup( request?: protos.google.cloud.filestore.v1.ICreateBackupRequest, options?: CallOptions @@ -1252,38 +1267,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Creates a backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The backup's project and location, in the format - * `projects/{project_number}/locations/{location}`. In Cloud Filestore, - * backup locations map to GCP regions, for example **us-west1**. - * @param {google.cloud.filestore.v1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} - * @param {string} request.backupId - * Required. The ID to use for the backup. - * The ID must be unique within the specified project and location. - * - * This value must start with a lowercase letter followed by up to 62 - * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - * Values that do not match this pattern will trigger an INVALID_ARGUMENT - * error. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.createBackup(request); - * const [response] = await operation.promise(); - */ createBackup( request?: protos.google.cloud.filestore.v1.ICreateBackupRequest, optionsOrCallback?: @@ -1341,11 +1324,8 @@ export class CloudFilestoreManagerClient { * 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 checkCreateBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_filestore_manager.create_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_CreateBackup_async */ async checkCreateBackupProgress( name: string @@ -1369,6 +1349,26 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * `projects/{project_number}/locations/{location}/backups/{backup_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_DeleteBackup_async + */ deleteBackup( request?: protos.google.cloud.filestore.v1.IDeleteBackupRequest, options?: CallOptions @@ -1405,27 +1405,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Deletes a backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The backup resource name, in the format - * `projects/{project_number}/locations/{location}/backups/{backup_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteBackup(request); - * const [response] = await operation.promise(); - */ deleteBackup( request?: protos.google.cloud.filestore.v1.IDeleteBackupRequest, optionsOrCallback?: @@ -1483,11 +1462,8 @@ export class CloudFilestoreManagerClient { * 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 checkDeleteBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_DeleteBackup_async */ async checkDeleteBackupProgress( name: string @@ -1511,6 +1487,28 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Updates the settings of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in + * this field. + * @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/cloud_filestore_manager.update_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_UpdateBackup_async + */ updateBackup( request?: protos.google.cloud.filestore.v1.IUpdateBackupRequest, options?: CallOptions @@ -1547,29 +1545,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Updates the settings of a specific backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.filestore.v1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1.Backup|backup resource} - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. At least one path must be supplied in - * this field. - * @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.updateBackup(request); - * const [response] = await operation.promise(); - */ updateBackup( request?: protos.google.cloud.filestore.v1.IUpdateBackupRequest, optionsOrCallback?: @@ -1627,11 +1602,8 @@ export class CloudFilestoreManagerClient { * 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 checkUpdateBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1/cloud_filestore_manager.update_backup.js + * region_tag:file_v1_generated_CloudFilestoreManager_UpdateBackup_async */ async checkUpdateBackupProgress( name: string @@ -1655,37 +1627,6 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } - listInstances( - request?: protos.google.cloud.filestore.v1.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.filestore.v1.IInstance[], - protos.google.cloud.filestore.v1.IListInstancesRequest | null, - protos.google.cloud.filestore.v1.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.filestore.v1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.filestore.v1.IListInstancesRequest, - | protos.google.cloud.filestore.v1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.filestore.v1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.filestore.v1.IListInstancesRequest, - | protos.google.cloud.filestore.v1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1.IInstance - > - ): void; /** * Lists all instances in a project for either a specified location * or for all locations. @@ -1720,6 +1661,37 @@ export class CloudFilestoreManagerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.filestore.v1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IInstance[], + protos.google.cloud.filestore.v1.IListInstancesRequest | null, + protos.google.cloud.filestore.v1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.filestore.v1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.filestore.v1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListInstancesRequest, + | protos.google.cloud.filestore.v1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1.IInstance + > + ): void; listInstances( request?: protos.google.cloud.filestore.v1.IListInstancesRequest, optionsOrCallback?: @@ -1848,11 +1820,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.list_instances.js + * region_tag:file_v1_generated_CloudFilestoreManager_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.filestore.v1.IListInstancesRequest, @@ -1866,7 +1835,6 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1876,33 +1844,6 @@ export class CloudFilestoreManagerClient { callSettings ) as AsyncIterable; } - listBackups( - request?: protos.google.cloud.filestore.v1.IListBackupsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.filestore.v1.IBackup[], - protos.google.cloud.filestore.v1.IListBackupsRequest | null, - protos.google.cloud.filestore.v1.IListBackupsResponse - ] - >; - listBackups( - request: protos.google.cloud.filestore.v1.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.filestore.v1.IListBackupsRequest, - protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, - protos.google.cloud.filestore.v1.IBackup - > - ): void; - listBackups( - request: protos.google.cloud.filestore.v1.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.filestore.v1.IListBackupsRequest, - protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, - protos.google.cloud.filestore.v1.IBackup - > - ): void; /** * Lists all backups in a project for either a specified location or for all * locations. @@ -1938,6 +1879,33 @@ export class CloudFilestoreManagerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listBackups( + request?: protos.google.cloud.filestore.v1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1.IBackup[], + protos.google.cloud.filestore.v1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.filestore.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.filestore.v1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.filestore.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1.IListBackupsRequest, + protos.google.cloud.filestore.v1.IListBackupsResponse | null | undefined, + protos.google.cloud.filestore.v1.IBackup + > + ): void; listBackups( request?: protos.google.cloud.filestore.v1.IListBackupsRequest, optionsOrCallback?: @@ -2066,11 +2034,8 @@ export class CloudFilestoreManagerClient { * 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.listBackupsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1/cloud_filestore_manager.list_backups.js + * region_tag:file_v1_generated_CloudFilestoreManager_ListBackups_async */ listBackupsAsync( request?: protos.google.cloud.filestore.v1.IListBackupsRequest, @@ -2084,7 +2049,6 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 528cf8af981..bb22e350eeb 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -458,6 +458,24 @@ export class CloudFilestoreManagerClient { // ------------------- // -- Service calls -- // ------------------- + /** + * Gets the details of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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/cloud_filestore_manager.get_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_GetInstance_async + */ getInstance( request?: protos.google.cloud.filestore.v1beta1.IGetInstanceRequest, options?: CallOptions @@ -489,24 +507,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Gets the details of a specific instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Instance]{@link google.cloud.filestore.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.filestore.v1beta1.IGetInstanceRequest, optionsOrCallback?: @@ -550,6 +550,24 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Gets the details of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1beta1.Backup}. + * 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/cloud_filestore_manager.get_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_GetBackup_async + */ getBackup( request?: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, options?: CallOptions @@ -581,24 +599,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Gets the details of a specific backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [Backup]{@link google.cloud.filestore.v1beta1.Backup}. - * 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.getBackup(request); - */ getBackup( request?: protos.google.cloud.filestore.v1beta1.IGetBackupRequest, optionsOrCallback?: @@ -643,6 +643,38 @@ export class CloudFilestoreManagerClient { return this.innerApiCalls.getBackup(request, options, callback); } + /** + * Creates an instance. + * When creating from a backup, the capacity of the new instance needs to be + * equal to or larger than the capacity of the backup (and also equal to or + * larger than the minimum capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * locations map to GCP zones, for example **us-west1-b**. + * @param {string} request.instanceId + * Required. The ID of the instance to create. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @param {google.cloud.filestore.v1beta1.Instance} request.instance + * Required. An {@link google.cloud.filestore.v1beta1.Instance|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/cloud_filestore_manager.create_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async + */ createInstance( request?: protos.google.cloud.filestore.v1beta1.ICreateInstanceRequest, options?: CallOptions @@ -679,39 +711,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Creates an instance. - * When creating from a backup, the capacity of the new instance needs to be - * equal to or larger than the capacity of the backup (and also equal to or - * larger than the minimum capacity of the tier). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, - * locations map to GCP zones, for example **us-west1-b**. - * @param {string} request.instanceId - * Required. The ID of the instance to create. - * The ID must be unique within the specified project and location. - * - * This value must start with a lowercase letter followed by up to 62 - * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - * @param {google.cloud.filestore.v1beta1.Instance} request.instance - * Required. An {@link google.cloud.filestore.v1beta1.Instance|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.filestore.v1beta1.ICreateInstanceRequest, optionsOrCallback?: @@ -769,11 +768,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.create_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async */ async checkCreateInstanceProgress( name: string @@ -797,6 +793,33 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Updates the settings of a specific instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. The elements of the repeated paths field may only include these + * fields: + * + * * "description" + * * "file_shares" + * * "labels" + * @param {google.cloud.filestore.v1beta1.Instance} request.instance + * Required. Only fields specified in update_mask are updated. + * @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/cloud_filestore_manager.update_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async + */ updateInstance( request?: protos.google.cloud.filestore.v1beta1.IUpdateInstanceRequest, options?: CallOptions @@ -833,34 +856,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Updates the settings of a specific instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. At least one path must be supplied in this - * field. The elements of the repeated paths field may only include these - * fields: - * - * * "description" - * * "file_shares" - * * "labels" - * @param {google.cloud.filestore.v1beta1.Instance} request.instance - * Required. Only fields specified in update_mask are updated. - * @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.filestore.v1beta1.IUpdateInstanceRequest, optionsOrCallback?: @@ -918,11 +913,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.update_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async */ async checkUpdateInstanceProgress( name: string @@ -946,6 +938,39 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Restores an existing instance's file share from a backup. + * + * The capacity of the instance needs to be equal to or larger than the + * capacity of the backup (and also equal to or larger than the minimum + * capacity of the tier). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the instance, in the format + * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. + * @param {string} request.fileShare + * Required. Name of the file share in the Cloud Filestore instance that the snapshot + * is being restored to. + * @param {string} request.sourceSnapshot + * The resource name of the snapshot, in the format + * `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`. + * @param {string} request.sourceBackup + * The resource name of the backup, in the format + * `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async + */ restoreInstance( request?: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, options?: CallOptions @@ -982,40 +1007,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Restores an existing instance's file share from a backup. - * - * The capacity of the instance needs to be equal to or larger than the - * capacity of the backup (and also equal to or larger than the minimum - * capacity of the tier). - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the instance, in the format - * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. - * @param {string} request.fileShare - * Required. Name of the file share in the Cloud Filestore instance that the snapshot - * is being restored to. - * @param {string} request.sourceSnapshot - * The resource name of the snapshot, in the format - * `projects/{project_id}/locations/{location_id}/snapshots/{snapshot_id}`. - * @param {string} request.sourceBackup - * The resource name of the backup, in the format - * `projects/{project_id}/locations/{location_id}/backups/{backup_id}`. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.restoreInstance(request); - * const [response] = await operation.promise(); - */ restoreInstance( request?: protos.google.cloud.filestore.v1beta1.IRestoreInstanceRequest, optionsOrCallback?: @@ -1073,11 +1064,8 @@ export class CloudFilestoreManagerClient { * 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 checkRestoreInstanceProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async */ async checkRestoreInstanceProgress( name: string @@ -1101,6 +1089,26 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Deletes an instance. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async + */ deleteInstance( request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, options?: CallOptions @@ -1137,27 +1145,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Deletes an instance. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteInstance(request); - * const [response] = await operation.promise(); - */ deleteInstance( request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, optionsOrCallback?: @@ -1215,11 +1202,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async */ async checkDeleteInstanceProgress( name: string @@ -1243,6 +1227,35 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Creates a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * backup locations map to GCP regions, for example **us-west1**. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} + * @param {string} request.backupId + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @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/cloud_filestore_manager.create_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async + */ createBackup( request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, options?: CallOptions @@ -1279,36 +1292,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Creates a backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The backup's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, - * backup locations map to GCP regions, for example **us-west1**. - * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} - * @param {string} request.backupId - * Required. The ID to use for the backup. - * The ID must be unique within the specified project and location. - * - * This value must start with a lowercase letter followed by up to 62 - * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. - * @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.createBackup(request); - * const [response] = await operation.promise(); - */ createBackup( request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, optionsOrCallback?: @@ -1366,11 +1349,8 @@ export class CloudFilestoreManagerClient { * 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 checkCreateBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/cloud_filestore_manager.create_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async */ async checkCreateBackupProgress( name: string @@ -1394,6 +1374,26 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async + */ deleteBackup( request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, options?: CallOptions @@ -1430,27 +1430,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Deletes a backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) - * for more details and examples. - * @example - * const [operation] = await client.deleteBackup(request); - * const [response] = await operation.promise(); - */ deleteBackup( request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, optionsOrCallback?: @@ -1508,11 +1487,8 @@ export class CloudFilestoreManagerClient { * 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 checkDeleteBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async */ async checkDeleteBackupProgress( name: string @@ -1536,6 +1512,28 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } + /** + * Updates the settings of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * @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/cloud_filestore_manager.update_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async + */ updateBackup( request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, options?: CallOptions @@ -1572,29 +1570,6 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - /** - * Updates the settings of a specific backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Mask of fields to update. At least one path must be supplied in this - * field. - * @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.updateBackup(request); - * const [response] = await operation.promise(); - */ updateBackup( request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, optionsOrCallback?: @@ -1652,11 +1627,8 @@ export class CloudFilestoreManagerClient { * 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 checkUpdateBackupProgress(name); - * console.log(decodedOperation.result); - * console.log(decodedOperation.done); - * console.log(decodedOperation.metadata); + * @example include:samples/generated/v1beta1/cloud_filestore_manager.update_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async */ async checkUpdateBackupProgress( name: string @@ -1680,37 +1652,6 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.OperationMetadata >; } - listInstances( - request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.filestore.v1beta1.IInstance[], - protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, - protos.google.cloud.filestore.v1beta1.IListInstancesResponse - ] - >; - listInstances( - request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IInstance - > - ): void; - listInstances( - request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IInstance - > - ): void; /** * Lists all instances in a project for either a specified location * or for all locations. @@ -1745,6 +1686,37 @@ export class CloudFilestoreManagerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listInstances( + request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance[], + protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, + protos.google.cloud.filestore.v1beta1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; listInstances( request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, optionsOrCallback?: @@ -1873,11 +1845,8 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.list_instances.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListInstances_async */ listInstancesAsync( request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, @@ -1891,7 +1860,6 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listInstances']; const callSettings = defaultCallSettings.merge(options); this.initialize(); @@ -1901,37 +1869,6 @@ export class CloudFilestoreManagerClient { callSettings ) as AsyncIterable; } - listBackups( - request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - options?: CallOptions - ): Promise< - [ - protos.google.cloud.filestore.v1beta1.IBackup[], - protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, - protos.google.cloud.filestore.v1beta1.IListBackupsResponse - ] - >; - listBackups( - request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IBackup - > - ): void; - listBackups( - request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IBackup - > - ): void; /** * Lists all backups in a project for either a specified location or for all * locations. @@ -1967,6 +1904,37 @@ export class CloudFilestoreManagerClient { * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. */ + listBackups( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup[], + protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1beta1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; listBackups( request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, optionsOrCallback?: @@ -2097,11 +2065,8 @@ export class CloudFilestoreManagerClient { * 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.listBackupsAsync(request); - * for await (const response of iterable) { - * // process response - * } + * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_backups.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListBackups_async */ listBackupsAsync( request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, @@ -2115,7 +2080,6 @@ export class CloudFilestoreManagerClient { gax.routingHeader.fromParams({ parent: request.parent || '', }); - options = options || {}; const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); From 8378959619d5b93be2a9450853114bd5c2af4149 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:16:20 +0000 Subject: [PATCH 21/59] build: add generated samples to .eslintignore (#31) --- packages/google-cloud-filestore/.eslintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/google-cloud-filestore/.eslintignore b/packages/google-cloud-filestore/.eslintignore index 9340ad9b86d..ea5b04aebe6 100644 --- a/packages/google-cloud-filestore/.eslintignore +++ b/packages/google-cloud-filestore/.eslintignore @@ -4,3 +4,4 @@ test/fixtures build/ docs/ protos/ +samples/generated/ From b2dea19d49135e40fc1a5816ee5e84dc58fc3dd2 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:38:18 +0000 Subject: [PATCH 22/59] docs(node): support "stable"/"preview" release level (#1312) (#34) --- packages/google-cloud-filestore/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index ae19d06f0f2..fd6223a3da5 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -129,6 +129,8 @@ are addressed with the highest priority. + + More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 2ccaa79bdcb3d773aff1172887a69f9484d472c6 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 30 Dec 2021 11:33:01 -0500 Subject: [PATCH 23/59] chore: add api_shortname and library_type to repo metadata (#33) --- packages/google-cloud-filestore/.repo-metadata.json | 6 ++++-- packages/google-cloud-filestore/README.md | 9 ++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/google-cloud-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index 57ab4cf56a5..4539210accc 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -4,11 +4,13 @@ "product_documentation": "https://cloud.google.com/filestore/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/filestore/latest", "issue_tracker": "https://github.com/googleapis/nodejs-filestore/issues", - "release_level": "ga", + "release_level": "stable", "language": "nodejs", "repo": "googleapis/nodejs-filestore", "distribution_name": "@google-cloud/filestore", "api_id": "file.googleapis.com", "default_version": "v1", - "requires_billing": true + "requires_billing": true, + "api_shortname": "filestore", + "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index fd6223a3da5..5b436d860ea 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -4,7 +4,7 @@ # [Filestore: Node.js Client](https://github.com/googleapis/nodejs-filestore) -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) + [![npm version](https://img.shields.io/npm/v/@google-cloud/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) [![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) @@ -119,10 +119,10 @@ _Legacy Node.js versions are supported as a best effort:_ This library follows [Semantic Versioning](http://semver.org/). -This library is considered to be **General Availability (GA)**. This means it -is stable; the code surface will not change in backwards-incompatible ways + +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 **GA** libraries +an extensive deprecation period. Issues and requests against **stable** libraries are addressed with the highest priority. @@ -130,7 +130,6 @@ are addressed with the highest priority. - More Information: [Google Cloud Platform Launch Stages][launch_stages] [launch_stages]: https://cloud.google.com/terms/launch-stages From 1d1b9f68abea832c5862543463d0e8968da7c478 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 24/59] docs(badges): tweak badge to use new preview/stable language (#1314) (#36) --- packages/google-cloud-filestore/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index 5b436d860ea..a7586cfff77 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -4,9 +4,8 @@ # [Filestore: Node.js Client](https://github.com/googleapis/nodejs-filestore) - +[![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/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) -[![codecov](https://img.shields.io/codecov/c/github/googleapis/nodejs-filestore/main.svg?style=flat)](https://codecov.io/gh/googleapis/nodejs-filestore) From 409e1d7065add00c97ed5b6dfb7b9f2f9421eeb8 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:48 +0000 Subject: [PATCH 25/59] test(nodejs): remove 15 add 16 (#1322) (#38) --- packages/google-cloud-filestore/protos/protos.d.ts | 2 +- packages/google-cloud-filestore/protos/protos.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index 9e26b9dc5ce..ddfd19e97a4 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/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-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index 1afb2a91547..91f5f1a0fc5 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/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 d894b453f69bf2af368d340a2cabbcba29da8eec Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 00:44:17 -0800 Subject: [PATCH 26/59] build: update copyright year to 2022 (#41) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore(deps): upgrade gapic-generator-java to 2.4.1 PiperOrigin-RevId: 422607515 Source-Link: https://github.com/googleapis/googleapis/commit/ba2ffd6fe6642e28b4fed2ffae217b4c5f084034 Source-Link: https://github.com/googleapis/googleapis-gen/commit/73ba4add239a619da567ffbd4e5730fdd6de04d3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzNiYTRhZGQyMzlhNjE5ZGE1NjdmZmJkNGU1NzMwZmRkNmRlMDRkMyJ9 * 🦉 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-filestore/.jsdoc.js | 4 ++-- .../generated/v1/cloud_filestore_manager.create_backup.js | 3 ++- .../generated/v1/cloud_filestore_manager.create_instance.js | 3 ++- .../generated/v1/cloud_filestore_manager.delete_backup.js | 1 + .../generated/v1/cloud_filestore_manager.delete_instance.js | 1 + .../generated/v1/cloud_filestore_manager.get_backup.js | 1 + .../generated/v1/cloud_filestore_manager.get_instance.js | 1 + .../generated/v1/cloud_filestore_manager.list_backups.js | 3 ++- .../generated/v1/cloud_filestore_manager.list_instances.js | 3 ++- .../v1/cloud_filestore_manager.restore_instance.js | 1 + .../generated/v1/cloud_filestore_manager.update_backup.js | 3 ++- .../generated/v1/cloud_filestore_manager.update_instance.js | 4 +++- .../v1beta1/cloud_filestore_manager.create_backup.js | 6 +++--- .../v1beta1/cloud_filestore_manager.create_instance.js | 6 +++--- .../v1beta1/cloud_filestore_manager.delete_backup.js | 4 ++-- .../v1beta1/cloud_filestore_manager.delete_instance.js | 4 ++-- .../generated/v1beta1/cloud_filestore_manager.get_backup.js | 4 ++-- .../v1beta1/cloud_filestore_manager.get_instance.js | 4 ++-- .../v1beta1/cloud_filestore_manager.list_backups.js | 6 +++--- .../v1beta1/cloud_filestore_manager.list_instances.js | 6 +++--- .../v1beta1/cloud_filestore_manager.restore_instance.js | 4 ++-- .../v1beta1/cloud_filestore_manager.update_backup.js | 6 +++--- .../v1beta1/cloud_filestore_manager.update_instance.js | 4 ++-- .../src/v1/cloud_filestore_manager_client.ts | 2 +- packages/google-cloud-filestore/src/v1/index.ts | 2 +- .../src/v1beta1/cloud_filestore_manager_client.ts | 2 +- packages/google-cloud-filestore/src/v1beta1/index.ts | 2 +- .../system-test/fixtures/sample/src/index.js | 2 +- .../system-test/fixtures/sample/src/index.ts | 2 +- packages/google-cloud-filestore/system-test/install.ts | 2 +- .../test/gapic_cloud_filestore_manager_v1.ts | 2 +- .../test/gapic_cloud_filestore_manager_v1beta1.ts | 2 +- 32 files changed, 56 insertions(+), 44 deletions(-) diff --git a/packages/google-cloud-filestore/.jsdoc.js b/packages/google-cloud-filestore/.jsdoc.js index 46ffdfdbe5f..52876d4262e 100644 --- a/packages/google-cloud-filestore/.jsdoc.js +++ b/packages/google-cloud-filestore/.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/filestore', diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js index 939befb1c6e..ae868a0ddac 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, backup, backupId) { @@ -26,7 +27,7 @@ function main(parent, backup, backupId) { */ // const parent = 'abc123' /** - * Required. A backup resource google.cloud.filestore.v1.Backup + * Required. A backup resource google.cloud.filestore.v1.Backup */ // const backup = {} /** diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js index 5aff786f26f..c0c19b55f26 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, instanceId, instance) { @@ -31,7 +32,7 @@ function main(parent, instanceId, instance) { */ // const instanceId = 'abc123' /** - * Required. An instance resource google.cloud.filestore.v1.Instance + * Required. An instance resource google.cloud.filestore.v1.Instance */ // const instance = {} diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js index 59c13d4d9a6..53bfadb59c1 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js index 352744e15d3..944b49c6c91 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js index 7053baf6c49..ca8fb341b42 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js index 0271cb59cbe..656a623d43d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index f67c239fdb3..a97f6667a23 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -61,7 +62,7 @@ function main(parent) { // Run request const iterable = await filestoreClient.listBackupsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 52b67e24501..57f14cec46a 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -60,7 +61,7 @@ function main(parent) { // Run request const iterable = await filestoreClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index b9a405f702a..732095f6d83 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, fileShare) { diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 29b33890384..3291c8da7c1 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(backup, updateMask) { @@ -20,7 +21,7 @@ function main(backup, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A backup resource google.cloud.filestore.v1.Backup + * Required. A backup resource google.cloud.filestore.v1.Backup */ // const backup = {} /** diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js index d5a4d96af69..32a86c37ee7 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main() { @@ -41,7 +42,8 @@ function main() { async function callUpdateInstance() { // Construct request - const request = {}; + const request = { + }; // Run request const [operation] = await filestoreClient.updateInstance(request); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index 38fcd949ec6..8e10c92aa4c 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, backup, backupId) { @@ -26,7 +27,7 @@ function main(parent, backup, backupId) { */ // const parent = 'abc123' /** - * Required. A backup resource google.cloud.filestore.v1beta1.Backup + * Required. A backup resource google.cloud.filestore.v1beta1.Backup */ // const backup = {} /** @@ -38,8 +39,7 @@ function main(parent, backup, backupId) { // const backupId = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index 3ea5039f538..82a6a00965a 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent, instanceId, instance) { @@ -33,13 +34,12 @@ function main(parent, instanceId, instance) { */ // const instanceId = 'abc123' /** - * Required. An instance resource google.cloud.filestore.v1beta1.Instance + * Required. An instance resource google.cloud.filestore.v1beta1.Instance */ // const instance = {} // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js index 8b01eb81ff3..e73ba99fdb9 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index 6c9ca8572a8..3691a68c0fa 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js index 49201a3d98f..1167a9517b5 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js index 7cb923b91d2..ab33ae4aec5 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name) { @@ -26,8 +27,7 @@ function main(name) { // const name = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 647c4a28d46..94801f20c32 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -47,8 +48,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); @@ -62,7 +62,7 @@ function main(parent) { // Run request const iterable = await filestoreClient.listBackupsAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js index 5367bab35a2..c2d16fda48f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(parent) { @@ -46,8 +47,7 @@ function main(parent) { // const filter = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); @@ -61,7 +61,7 @@ function main(parent) { // Run request const iterable = await filestoreClient.listInstancesAsync(request); for await (const response of iterable) { - console.log(response); + console.log(response); } } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index 360e9569f27..0ad48f86df4 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(name, fileShare) { @@ -41,8 +42,7 @@ function main(name, fileShare) { // const sourceBackup = 'abc123' // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js index 9b53ba023b8..00cdcbcb056 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(backup, updateMask) { @@ -20,7 +21,7 @@ function main(backup, updateMask) { * TODO(developer): Uncomment these variables before running the sample. */ /** - * Required. A backup resource google.cloud.filestore.v1beta1.Backup + * Required. A backup resource google.cloud.filestore.v1beta1.Backup */ // const backup = {} /** @@ -30,8 +31,7 @@ function main(backup, updateMask) { // const updateMask = {} // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js index 66a7190fe10..6304985e1ab 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. + 'use strict'; function main(updateMask, instance) { @@ -34,8 +35,7 @@ function main(updateMask, instance) { // const instance = {} // Imports the Filestore library - const {CloudFilestoreManagerClient} = - require('@google-cloud/filestore').v1beta1; + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; // Instantiates a client const filestoreClient = new CloudFilestoreManagerClient(); diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 7255c1ec2b5..17e4d9e6860 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_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. diff --git a/packages/google-cloud-filestore/src/v1/index.ts b/packages/google-cloud-filestore/src/v1/index.ts index 0f214d8ceae..1ea214281cf 100644 --- a/packages/google-cloud-filestore/src/v1/index.ts +++ b/packages/google-cloud-filestore/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-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index bb22e350eeb..bf822b0fa3e 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_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. diff --git a/packages/google-cloud-filestore/src/v1beta1/index.ts b/packages/google-cloud-filestore/src/v1beta1/index.ts index 0f214d8ceae..1ea214281cf 100644 --- a/packages/google-cloud-filestore/src/v1beta1/index.ts +++ b/packages/google-cloud-filestore/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-filestore/system-test/fixtures/sample/src/index.js b/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.js index 3e3856b8467..dfbf36ae8ae 100644 --- a/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-filestore/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-filestore/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts index 97448a3c4b3..679aff4c73c 100644 --- a/packages/google-cloud-filestore/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-filestore/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-filestore/system-test/install.ts b/packages/google-cloud-filestore/system-test/install.ts index d2d61c0396f..6dd1eaadafa 100644 --- a/packages/google-cloud-filestore/system-test/install.ts +++ b/packages/google-cloud-filestore/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-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 5f3a2249b7a..6e25f2891eb 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_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. diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index fbf853867c0..299dbd499f1 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_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. From 319bbf2b6df7e80d6fb7bbcb7c524b4223cf485c 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:30:46 +0000 Subject: [PATCH 27/59] chore: update v2.12.0 gapic-generator-typescript (#44) - [ ] 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 --- .../linkinator.config.json | 10 +- .../v1beta1/cloud_filestore_service.proto | 48 ++- .../google-cloud-filestore/protos/protos.d.ts | 131 ++++++ .../google-cloud-filestore/protos/protos.js | 394 ++++++++++++++++++ .../google-cloud-filestore/protos/protos.json | 59 ++- .../v1beta1/cloud_filestore_manager_client.ts | 22 +- .../gapic_cloud_filestore_manager_v1beta1.ts | 12 + 7 files changed, 664 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-filestore/linkinator.config.json b/packages/google-cloud-filestore/linkinator.config.json index 0121dfa684f..befd23c8633 100644 --- a/packages/google-cloud-filestore/linkinator.config.json +++ b/packages/google-cloud-filestore/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-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto index 8fd09e6bceb..eff84710592 100644 --- a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -32,11 +32,6 @@ option java_outer_classname = "CloudFilestoreServiceProto"; option java_package = "com.google.cloud.filestore.v1beta1"; option php_namespace = "Google\\Cloud\\Filestore\\V1beta1"; -option (google.api.resource_definition) = { - type: "file.googleapis.com/Snapshot" - pattern: "projects/{project}/locations/{location}/snapshots/{snapshot}" -}; - // Configures and manages Cloud Filestore resources. // // Cloud Filestore Manager v1beta1. @@ -550,6 +545,49 @@ message ListInstancesResponse { repeated string unreachable = 3; } +// A Cloud Filestore snapshot. +message Snapshot { + option (google.api.resource) = { + type: "file.googleapis.com/Snapshot" + pattern: "projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}" + }; + + // The snapshot state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Snapshot is being created. + CREATING = 1; + + // Snapshot is available for use. + READY = 3; + + // Snapshot is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the snapshot, in the format + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // A description of the snapshot with 2048 characters or less. + // Requests with longer descriptions will be rejected. + string description = 2; + + // Output only. The snapshot state. + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the snapshot was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 5; + + // Output only. The amount of bytes needed to allocate a full copy of the snapshot content + int64 filesystem_used_bytes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + // A Cloud Filestore backup. message Backup { option (google.api.resource) = { diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index ddfd19e97a4..51d28c70f08 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/protos/protos.d.ts @@ -3902,6 +3902,137 @@ export namespace google { public toJSON(): { [k: string]: any }; } + /** Properties of a Snapshot. */ + interface ISnapshot { + + /** Snapshot name */ + name?: (string|null); + + /** Snapshot description */ + description?: (string|null); + + /** Snapshot state */ + state?: (google.cloud.filestore.v1beta1.Snapshot.State|keyof typeof google.cloud.filestore.v1beta1.Snapshot.State|null); + + /** Snapshot createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels */ + labels?: ({ [k: string]: string }|null); + + /** Snapshot filesystemUsedBytes */ + filesystemUsedBytes?: (number|Long|string|null); + } + + /** Represents a Snapshot. */ + class Snapshot implements ISnapshot { + + /** + * Constructs a new Snapshot. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.ISnapshot); + + /** Snapshot name. */ + public name: string; + + /** Snapshot description. */ + public description: string; + + /** Snapshot state. */ + public state: (google.cloud.filestore.v1beta1.Snapshot.State|keyof typeof google.cloud.filestore.v1beta1.Snapshot.State); + + /** Snapshot createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Snapshot labels. */ + public labels: { [k: string]: string }; + + /** Snapshot filesystemUsedBytes. */ + public filesystemUsedBytes: (number|Long|string); + + /** + * Creates a new Snapshot instance using the specified properties. + * @param [properties] Properties to set + * @returns Snapshot instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.ISnapshot): google.cloud.filestore.v1beta1.Snapshot; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.cloud.filestore.v1beta1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Snapshot.verify|verify} messages. + * @param message Snapshot message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.ISnapshot, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.Snapshot; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.Snapshot; + + /** + * Verifies a Snapshot message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Snapshot + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.Snapshot; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @param message Snapshot + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.Snapshot, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Snapshot to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Snapshot { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 3, + DELETING = 4 + } + } + /** Properties of a Backup. */ interface IBackup { diff --git a/packages/google-cloud-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index 91f5f1a0fc5..c274bb04e5a 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/protos/protos.js @@ -9752,6 +9752,400 @@ return ListInstancesResponse; })(); + v1beta1.Snapshot = (function() { + + /** + * Properties of a Snapshot. + * @memberof google.cloud.filestore.v1beta1 + * @interface ISnapshot + * @property {string|null} [name] Snapshot name + * @property {string|null} [description] Snapshot description + * @property {google.cloud.filestore.v1beta1.Snapshot.State|null} [state] Snapshot state + * @property {google.protobuf.ITimestamp|null} [createTime] Snapshot createTime + * @property {Object.|null} [labels] Snapshot labels + * @property {number|Long|null} [filesystemUsedBytes] Snapshot filesystemUsedBytes + */ + + /** + * Constructs a new Snapshot. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a Snapshot. + * @implements ISnapshot + * @constructor + * @param {google.cloud.filestore.v1beta1.ISnapshot=} [properties] Properties to set + */ + function Snapshot(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Snapshot name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.name = ""; + + /** + * Snapshot description. + * @member {string} description + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.description = ""; + + /** + * Snapshot state. + * @member {google.cloud.filestore.v1beta1.Snapshot.State} state + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.state = 0; + + /** + * Snapshot createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.createTime = null; + + /** + * Snapshot labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.labels = $util.emptyObject; + + /** + * Snapshot filesystemUsedBytes. + * @member {number|Long} filesystemUsedBytes + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + */ + Snapshot.prototype.filesystemUsedBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Snapshot instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {google.cloud.filestore.v1beta1.ISnapshot=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.Snapshot} Snapshot instance + */ + Snapshot.create = function create(properties) { + return new Snapshot(properties); + }; + + /** + * Encodes the specified Snapshot message. Does not implicitly {@link google.cloud.filestore.v1beta1.Snapshot.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {google.cloud.filestore.v1beta1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.filesystemUsedBytes != null && Object.hasOwnProperty.call(message, "filesystemUsedBytes")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.filesystemUsedBytes); + return writer; + }; + + /** + * Encodes the specified Snapshot message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Snapshot.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {google.cloud.filestore.v1beta1.ISnapshot} message Snapshot message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Snapshot.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.Snapshot(), 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.state = reader.int32(); + break; + case 4: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 5: + 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 12: + message.filesystemUsedBytes = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Snapshot message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.Snapshot} Snapshot + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Snapshot.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Snapshot message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Snapshot.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + 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.filesystemUsedBytes != null && message.hasOwnProperty("filesystemUsedBytes")) + if (!$util.isInteger(message.filesystemUsedBytes) && !(message.filesystemUsedBytes && $util.isInteger(message.filesystemUsedBytes.low) && $util.isInteger(message.filesystemUsedBytes.high))) + return "filesystemUsedBytes: integer|Long expected"; + return null; + }; + + /** + * Creates a Snapshot message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.Snapshot} Snapshot + */ + Snapshot.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.Snapshot) + return object; + var message = new $root.google.cloud.filestore.v1beta1.Snapshot(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Snapshot.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Snapshot.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.filesystemUsedBytes != null) + if ($util.Long) + (message.filesystemUsedBytes = $util.Long.fromValue(object.filesystemUsedBytes)).unsigned = false; + else if (typeof object.filesystemUsedBytes === "string") + message.filesystemUsedBytes = parseInt(object.filesystemUsedBytes, 10); + else if (typeof object.filesystemUsedBytes === "number") + message.filesystemUsedBytes = object.filesystemUsedBytes; + else if (typeof object.filesystemUsedBytes === "object") + message.filesystemUsedBytes = new $util.LongBits(object.filesystemUsedBytes.low >>> 0, object.filesystemUsedBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Snapshot message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {google.cloud.filestore.v1beta1.Snapshot} message Snapshot + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Snapshot.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.filesystemUsedBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.filesystemUsedBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Snapshot.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, 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.filesystemUsedBytes != null && message.hasOwnProperty("filesystemUsedBytes")) + if (typeof message.filesystemUsedBytes === "number") + object.filesystemUsedBytes = options.longs === String ? String(message.filesystemUsedBytes) : message.filesystemUsedBytes; + else + object.filesystemUsedBytes = options.longs === String ? $util.Long.prototype.toString.call(message.filesystemUsedBytes) : options.longs === Number ? new $util.LongBits(message.filesystemUsedBytes.low >>> 0, message.filesystemUsedBytes.high >>> 0).toNumber() : message.filesystemUsedBytes; + return object; + }; + + /** + * Converts this Snapshot to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @instance + * @returns {Object.} JSON object + */ + Snapshot.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.filestore.v1beta1.Snapshot.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=3 READY value + * @property {number} DELETING=4 DELETING value + */ + Snapshot.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Snapshot; + })(); + v1beta1.Backup = (function() { /** diff --git a/packages/google-cloud-filestore/protos/protos.json b/packages/google-cloud-filestore/protos/protos.json index 23403a77892..6c6c67956e3 100644 --- a/packages/google-cloud-filestore/protos/protos.json +++ b/packages/google-cloud-filestore/protos/protos.json @@ -903,9 +903,7 @@ "java_multiple_files": true, "java_outer_classname": "CloudFilestoreServiceProto", "java_package": "com.google.cloud.filestore.v1beta1", - "php_namespace": "Google\\Cloud\\Filestore\\V1beta1", - "(google.api.resource_definition).type": "file.googleapis.com/Snapshot", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/snapshots/{snapshot}" + "php_namespace": "Google\\Cloud\\Filestore\\V1beta1" }, "nested": { "CloudFilestoreManager": { @@ -1529,6 +1527,61 @@ } } }, + "Snapshot": { + "options": { + "(google.api.resource).type": "file.googleapis.com/Snapshot", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2 + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "filesystemUsedBytes": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 3, + "DELETING": 4 + } + } + } + }, "Backup": { "options": { "(google.api.resource).type": "file.googleapis.com/Backup", diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index bf822b0fa3e..7490a56dd13 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -198,7 +198,7 @@ export class CloudFilestoreManagerClient { 'projects/{project}/locations/{location}' ), snapshotPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/snapshots/{snapshot}' + 'projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}' ), }; @@ -2232,13 +2232,20 @@ export class CloudFilestoreManagerClient { * * @param {string} project * @param {string} location + * @param {string} instance * @param {string} snapshot * @returns {string} Resource name string. */ - snapshotPath(project: string, location: string, snapshot: string) { + snapshotPath( + project: string, + location: string, + instance: string, + snapshot: string + ) { return this.pathTemplates.snapshotPathTemplate.render({ project: project, location: location, + instance: instance, snapshot: snapshot, }); } @@ -2265,6 +2272,17 @@ export class CloudFilestoreManagerClient { return this.pathTemplates.snapshotPathTemplate.match(snapshotName).location; } + /** + * Parse the instance from Snapshot resource. + * + * @param {string} snapshotName + * A fully-qualified path representing Snapshot resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromSnapshotName(snapshotName: string) { + return this.pathTemplates.snapshotPathTemplate.match(snapshotName).instance; + } + /** * Parse the snapshot from Snapshot resource. * diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index 299dbd499f1..03bdd39b454 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -2671,6 +2671,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const expectedParameters = { project: 'projectValue', location: 'locationValue', + instance: 'instanceValue', snapshot: 'snapshotValue', }; const client = @@ -2690,6 +2691,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const result = client.snapshotPath( 'projectValue', 'locationValue', + 'instanceValue', 'snapshotValue' ); assert.strictEqual(result, fakePath); @@ -2720,6 +2722,16 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); + it('matchInstanceFromSnapshotName', () => { + const result = client.matchInstanceFromSnapshotName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.snapshotPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + it('matchSnapshotFromSnapshotName', () => { const result = client.matchSnapshotFromSnapshotName(fakePath); assert.strictEqual(result, 'snapshotValue'); From 56a56179de41f1032265c703f998a8afeee0df7b Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 1 Feb 2022 23:37:58 +0100 Subject: [PATCH 28/59] chore(deps): update dependency sinon to v13 (#46) --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 5fc206773a6..e76e8a2ebf7 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 189a444bb0f902105ed71fa74bf7914ec9be8172 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:10:43 +0000 Subject: [PATCH 29/59] docs(nodejs): version support policy edits (#1346) (#49) --- packages/google-cloud-filestore/README.md | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index a7586cfff77..4b9848f581b 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -97,21 +97,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/filestore@legacy-8` installs client libraries +for versions compatible with Node.js 8. ## Versioning From 279b686121cff5e64e49b00b9bf5cd90949ed786 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 11:30:00 -0800 Subject: [PATCH 30/59] chore(main): release 1.1.2 (#47) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- packages/google-cloud-filestore/CHANGELOG.md | 7 +++++++ packages/google-cloud-filestore/package.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 006d2983327..43f7262f9cf 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### [1.1.2](https://github.com/googleapis/nodejs-filestore/compare/v1.1.1...v1.1.2) (2022-02-03) + + +### Bug Fixes + +* update the pattern for "file.googleapis.com/Snapshot" resource for the Filestore V1Beta1 ([#43](https://github.com/googleapis/nodejs-filestore/issues/43)) ([1b6e7b7](https://github.com/googleapis/nodejs-filestore/commit/1b6e7b71d739c3c428410b343c824907e3d58cc6)) + ### [1.1.1](https://www.github.com/googleapis/nodejs-filestore/compare/v1.1.0...v1.1.1) (2021-10-14) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index e76e8a2ebf7..7abdca1dcd5 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "1.1.1", + "version": "1.1.2", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index 76e5b893c39..e4623fffeb9 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^1.1.1" + "@google-cloud/filestore": "^1.1.2" }, "devDependencies": { "c8": "^7.3.0", From 3c6b8680d57696a352aac4693e07d4b30a42d125 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:47 +0000 Subject: [PATCH 31/59] docs(samples): include metadata file, add exclusions for samples to handwritten libraries (#50) - [ ] 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 --- .../cloud_filestore_manager.create_backup.js | 9 +- ...cloud_filestore_manager.create_instance.js | 9 +- .../cloud_filestore_manager.delete_backup.js | 9 +- ...cloud_filestore_manager.delete_instance.js | 9 +- .../v1/cloud_filestore_manager.get_backup.js | 9 +- .../cloud_filestore_manager.get_instance.js | 9 +- .../cloud_filestore_manager.list_backups.js | 9 +- .../cloud_filestore_manager.list_instances.js | 9 +- ...loud_filestore_manager.restore_instance.js | 9 +- .../cloud_filestore_manager.update_backup.js | 9 +- ...cloud_filestore_manager.update_instance.js | 9 +- ...et_metadata.google.cloud.filestore.v1.json | 519 +++++++++++++++++ .../cloud_filestore_manager.create_backup.js | 9 +- ...cloud_filestore_manager.create_instance.js | 9 +- .../cloud_filestore_manager.delete_backup.js | 9 +- ...cloud_filestore_manager.delete_instance.js | 9 +- .../cloud_filestore_manager.get_backup.js | 9 +- .../cloud_filestore_manager.get_instance.js | 9 +- .../cloud_filestore_manager.list_backups.js | 9 +- .../cloud_filestore_manager.list_instances.js | 9 +- ...loud_filestore_manager.restore_instance.js | 9 +- .../cloud_filestore_manager.update_backup.js | 9 +- ...cloud_filestore_manager.update_instance.js | 9 +- ...tadata.google.cloud.filestore.v1beta1.json | 523 ++++++++++++++++++ .../src/v1/cloud_filestore_manager_client.ts | 5 +- .../v1beta1/cloud_filestore_manager_client.ts | 5 +- .../test/gapic_cloud_filestore_manager_v1.ts | 54 +- .../gapic_cloud_filestore_manager_v1beta1.ts | 54 +- 28 files changed, 1304 insertions(+), 54 deletions(-) create mode 100644 packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js index ae868a0ddac..522528ea9a2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.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-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js index c0c19b55f26..f1ee31af676 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js index 53bfadb59c1..e7a3f857a5d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.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-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js index 944b49c6c91..160d13046bd 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js index ca8fb341b42..dbf655241ca 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.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-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js index 656a623d43d..64c7a269f81 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index a97f6667a23..37fe21306b2 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.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-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 57f14cec46a..800afa0218c 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index 732095f6d83..2be0689e19d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_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-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 3291c8da7c1..153cf08ed8b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.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-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js index 32a86c37ee7..80af3634128 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.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-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json new file mode 100644 index 00000000000..8ff56c35917 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -0,0 +1,519 @@ +{ + "clientLibrary": { + "name": "nodejs-filestore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "file_v1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } + } + ] +} diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index 8e10c92aa4c..8a1d810399f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index 82a6a00965a..efd8d806f5b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js index e73ba99fdb9..29babc4b0d9 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index 3691a68c0fa..115388bfcbf 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js index 1167a9517b5..6a1ba8dcb04 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js index ab33ae4aec5..5b1b616b021 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 94801f20c32..20b4215eab0 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js index c2d16fda48f..550c331c3ce 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index 0ad48f86df4..feac01861bb 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js index 00cdcbcb056..d1c471ad7fc 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.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-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js index 6304985e1ab..176ad3d1cd0 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.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-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json new file mode 100644 index 00000000000..319df898695 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -0,0 +1,523 @@ +{ + "clientLibrary": { + "name": "nodejs-filestore", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_snapshot", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + } + ] +} diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 17e4d9e6860..63cf537d1f6 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -2203,9 +2203,8 @@ export class CloudFilestoreManagerClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudFilestoreManagerStub!.then(stub => { + if (this.cloudFilestoreManagerStub && !this._terminated) { + return this.cloudFilestoreManagerStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 7490a56dd13..40da3dbaa7a 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -2301,9 +2301,8 @@ export class CloudFilestoreManagerClient { * @returns {Promise} A promise that resolves when the client is closed. */ close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.cloudFilestoreManagerStub!.then(stub => { + if (this.cloudFilestoreManagerStub && !this._terminated) { + return this.cloudFilestoreManagerStub.then(stub => { this._terminated = true; stub.close(); this.operationsClient.close(); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 6e25f2891eb..578093cd2b1 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -189,13 +189,29 @@ describe('v1.CloudFilestoreManagerClient', () => { assert(client.cloudFilestoreManagerStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -346,6 +362,23 @@ describe('v1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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('getBackup', () => { @@ -457,6 +490,23 @@ describe('v1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBackup with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); }); describe('createInstance', () => { diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index 03bdd39b454..f24814baef4 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -191,13 +191,29 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert(client.cloudFilestoreManagerStub); }); - it('has close method', () => { + it('has close method for the initialized client', done => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.close(); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); + }); + }); + + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); + }); }); it('has getProjectId method', async () => { @@ -348,6 +364,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getInstance with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.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('getBackup', () => { @@ -459,6 +492,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .calledWith(request, expectedOptions, undefined) ); }); + + it('invokes getBackup with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetBackupRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getBackup(request), expectedError); + }); }); describe('createInstance', () => { From 83fec4ee3ab7469edc701179205bb9a414066175 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:36:31 +0000 Subject: [PATCH 32/59] chore: update v2.14.2 gapic-generator-typescript (#54) - [ ] 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 --- .../test/gapic_cloud_filestore_manager_v1.ts | 2 -- .../test/gapic_cloud_filestore_manager_v1beta1.ts | 2 -- 2 files changed, 4 deletions(-) diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 578093cd2b1..914d07c4894 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -374,7 +374,6 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.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); @@ -502,7 +501,6 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.GetBackupRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBackup(request), expectedError); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index f24814baef4..06c84e5da31 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -376,7 +376,6 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.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); @@ -504,7 +503,6 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); request.name = ''; - const expectedHeaderRequestParams = 'name='; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBackup(request), expectedError); From 69142347c25f81ff66e4435df86180f1804b64e6 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 12:44:55 -0700 Subject: [PATCH 33/59] build(node): update client library version in samples metadata (#1356) (#61) * 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 Co-authored-by: Owl Bot Co-authored-by: Benjamin E. Coe --- ...et_metadata.google.cloud.filestore.v1.json | 992 ++++++++-------- ...tadata.google.cloud.filestore.v1beta1.json | 1000 ++++++++--------- 2 files changed, 996 insertions(+), 996 deletions(-) diff --git a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json index 8ff56c35917..9c47f13309e 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -1,519 +1,519 @@ { - "clientLibrary": { - "name": "nodejs-filestore", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.filestore.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "file_v1_generated_CloudFilestoreManager_ListInstances_async", - "title": "CloudFilestoreManager listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists all instances in a project for either a specified location or for all locations.", - "canonical": true, - "file": "cloud_filestore_manager.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1.ListInstancesResponse", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } + "clientLibrary": { + "name": "nodejs-filestore", + "version": "1.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1", + "version": "v1" + } + ] }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_GetInstance_async", - "title": "CloudFilestoreManager getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific instance.", - "canonical": true, - "file": "cloud_filestore_manager.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1.Instance", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_CreateInstance_async", - "title": "CloudFilestoreManager createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", - "canonical": true, - "file": "cloud_filestore_manager.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 64, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.filestore.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateInstance_async", - "title": "CloudFilestoreManager updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific instance.", - "canonical": true, - "file": "cloud_filestore_manager.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.filestore.v1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 64, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_RestoreInstance_async", - "title": "CloudFilestoreManager restoreInstance Sample", - "origin": "API_DEFINITION", - "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", - "canonical": true, - "file": "cloud_filestore_manager.restore_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 63, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "file_share", - "type": "TYPE_STRING" - }, - { - "name": "source_backup", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "RestoreInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteInstance_async", - "title": "CloudFilestoreManager deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes an instance.", - "canonical": true, - "file": "cloud_filestore_manager.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 63, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_ListBackups_async", - "title": "CloudFilestoreManager listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists all backups in a project for either a specified location or for all locations.", - "canonical": true, - "file": "cloud_filestore_manager.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1.ListBackupsResponse", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_GetBackup_async", - "title": "CloudFilestoreManager getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific backup.", - "canonical": true, - "file": "cloud_filestore_manager.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1.Backup", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_CreateBackup_async", - "title": "CloudFilestoreManager createBackup Sample", - "origin": "API_DEFINITION", - "description": " Creates a backup.", - "canonical": true, - "file": "cloud_filestore_manager.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.cloud.filestore.v1.Backup" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteBackup_async", - "title": "CloudFilestoreManager deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a backup.", - "canonical": true, - "file": "cloud_filestore_manager.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateBackup_async", - "title": "CloudFilestoreManager updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific backup.", - "canonical": true, - "file": "cloud_filestore_manager.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "backup", - "type": ".google.cloud.filestore.v1.Backup" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + "regionTag": "file_v1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" - } + { + "regionTag": "file_v1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1.CloudFilestoreManager" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index 319df898695..de48671338a 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -1,523 +1,523 @@ { - "clientLibrary": { - "name": "nodejs-filestore", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.filestore.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListInstances_async", - "title": "CloudFilestoreManager listInstances Sample", - "origin": "API_DEFINITION", - "description": " Lists all instances in a project for either a specified location or for all locations.", - "canonical": true, - "file": "cloud_filestore_manager.list_instances.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListInstances", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1beta1.ListInstancesResponse", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" - }, - "method": { - "shortName": "ListInstances", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } + "clientLibrary": { + "name": "nodejs-filestore", + "version": "1.1.2", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.filestore.v1beta1", + "version": "v1beta1" + } + ] }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetInstance_async", - "title": "CloudFilestoreManager getInstance Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific instance.", - "canonical": true, - "file": "cloud_filestore_manager.get_instance.js", - "language": "JAVASCRIPT", - "segments": [ + "snippets": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1beta1.Instance", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListInstances_async", + "title": "CloudFilestoreManager listInstances Sample", + "origin": "API_DEFINITION", + "description": " Lists all instances in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_instances.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListInstancesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListInstances", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListInstances", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "GetInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async", - "title": "CloudFilestoreManager createInstance Sample", - "origin": "API_DEFINITION", - "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", - "canonical": true, - "file": "cloud_filestore_manager.create_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "instance_id", - "type": "TYPE_STRING" - }, - { - "name": "instance", - "type": ".google.cloud.filestore.v1beta1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetInstance_async", + "title": "CloudFilestoreManager getInstance Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.get_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Instance", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "CreateInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async", - "title": "CloudFilestoreManager updateInstance Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific instance.", - "canonical": true, - "file": "cloud_filestore_manager.update_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 61, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "instance", - "type": ".google.cloud.filestore.v1beta1.Instance" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateInstance_async", + "title": "CloudFilestoreManager createInstance Sample", + "origin": "API_DEFINITION", + "description": " Creates an instance. When creating from a backup, the capacity of the new instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.create_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "instance_id", + "type": "TYPE_STRING" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "UpdateInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async", - "title": "CloudFilestoreManager restoreInstance Sample", - "origin": "API_DEFINITION", - "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", - "canonical": true, - "file": "cloud_filestore_manager.restore_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "file_share", - "type": "TYPE_STRING" - }, - { - "name": "source_snapshot", - "type": "TYPE_STRING" - }, - { - "name": "source_backup", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateInstance_async", + "title": "CloudFilestoreManager updateInstance Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific instance.", + "canonical": true, + "file": "cloud_filestore_manager.update_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 61, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "instance", + "type": ".google.cloud.filestore.v1beta1.Instance" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "RestoreInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async", - "title": "CloudFilestoreManager deleteInstance Sample", - "origin": "API_DEFINITION", - "description": " Deletes an instance.", - "canonical": true, - "file": "cloud_filestore_manager.delete_instance.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_async", + "title": "CloudFilestoreManager restoreInstance Sample", + "origin": "API_DEFINITION", + "description": " Restores an existing instance's file share from a backup. The capacity of the instance needs to be equal to or larger than the capacity of the backup (and also equal to or larger than the minimum capacity of the tier).", + "canonical": true, + "file": "cloud_filestore_manager.restore_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "file_share", + "type": "TYPE_STRING" + }, + { + "name": "source_snapshot", + "type": "TYPE_STRING" + }, + { + "name": "source_backup", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RestoreInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RestoreInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "DeleteInstance", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListBackups_async", - "title": "CloudFilestoreManager listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists all backups in a project for either a specified location or for all locations.", - "canonical": true, - "file": "cloud_filestore_manager.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - }, - { - "name": "order_by", - "type": "TYPE_STRING" - }, - { - "name": "filter", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1beta1.ListBackupsResponse", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async", + "title": "CloudFilestoreManager deleteInstance Sample", + "origin": "API_DEFINITION", + "description": " Deletes an instance.", + "canonical": true, + "file": "cloud_filestore_manager.delete_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetBackup_async", - "title": "CloudFilestoreManager getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets the details of a specific backup.", - "canonical": true, - "file": "cloud_filestore_manager.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 51, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.filestore.v1beta1.Backup", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListBackups_async", + "title": "CloudFilestoreManager listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists all backups in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListBackupsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListBackups", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async", - "title": "CloudFilestoreManager createBackup Sample", - "origin": "API_DEFINITION", - "description": " Creates a backup.", - "canonical": true, - "file": "cloud_filestore_manager.create_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 66, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup", - "type": ".google.cloud.filestore.v1beta1.Backup" - }, - { - "name": "backup_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetBackup_async", + "title": "CloudFilestoreManager getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 51, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Backup", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "CreateBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async", - "title": "CloudFilestoreManager deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a backup.", - "canonical": true, - "file": "cloud_filestore_manager.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 52, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async", + "title": "CloudFilestoreManager createBackup Sample", + "origin": "API_DEFINITION", + "description": " Creates a backup.", + "canonical": true, + "file": "cloud_filestore_manager.create_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "backup_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } - } - } - }, - { - "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async", - "title": "CloudFilestoreManager updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a specific backup.", - "canonical": true, - "file": "cloud_filestore_manager.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ { - "start": 25, - "end": 57, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "backup", - "type": ".google.cloud.filestore.v1beta1.Backup" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "CloudFilestoreManagerClient", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async", + "title": "CloudFilestoreManager deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a backup.", + "canonical": true, + "file": "cloud_filestore_manager.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 52, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", - "service": { - "shortName": "CloudFilestoreManager", - "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" - } + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async", + "title": "CloudFilestoreManager updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific backup.", + "canonical": true, + "file": "cloud_filestore_manager.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 57, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "backup", + "type": ".google.cloud.filestore.v1beta1.Backup" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateBackup", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } } - } - } - ] -} + ] +} \ No newline at end of file From cf1d06e21a2df05fa0a13b627ed915ef5e8cc9b6 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 9 May 2022 17:36:15 +0200 Subject: [PATCH 34/59] chore(deps): update dependency sinon to v14 (#64) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 7abdca1dcd5..df4b0501060 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 5a55be9db9e151b83912e19a0c7a814ceb2d1d00 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Wed, 18 May 2022 18:51:35 -0700 Subject: [PATCH 35/59] build!: update library to use Node 12 (#66) * build!: Update library to use Node 12 Co-authored-by: Owl Bot --- packages/google-cloud-filestore/package.json | 8 ++++---- packages/google-cloud-filestore/samples/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index df4b0501060..d963ad53a61 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^2.24.1" + "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-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index e4623fffeb9..41d3f6f0d1b 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -4,7 +4,7 @@ "license": "Apache-2.0", "author": "Google LLC", "engines": { - "node": ">=12" + "node": ">=12.0.0" }, "files": [ "*.js" From 266ff000e90041d39a0b780f200037a77cd17ecf 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:49 -0400 Subject: [PATCH 36/59] chore(main): release 2.0.0 (#67) 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-filestore/CHANGELOG.md | 11 +++++++++++ packages/google-cloud-filestore/package.json | 2 +- .../snippet_metadata.google.cloud.filestore.v1.json | 2 +- ...ippet_metadata.google.cloud.filestore.v1beta1.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 43f7262f9cf..18474094cac 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/googleapis/nodejs-filestore/compare/v1.1.2...v2.0.0) (2022-05-19) + + +### ⚠ BREAKING CHANGES + +* update library to use Node 12 (#66) + +### Build System + +* update library to use Node 12 ([#66](https://github.com/googleapis/nodejs-filestore/issues/66)) ([fed26fc](https://github.com/googleapis/nodejs-filestore/commit/fed26fc96372b8c15237a1500ae27ce88d4ec936)) + ### [1.1.2](https://github.com/googleapis/nodejs-filestore/compare/v1.1.1...v1.1.2) (2022-02-03) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index d963ad53a61..da882394dee 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "1.1.2", + "version": "2.0.0", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json index 9c47f13309e..06186218418 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "1.1.2", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index de48671338a..519df4ca124 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "1.1.2", + "version": "2.0.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index 41d3f6f0d1b..ca920147945 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^1.1.2" + "@google-cloud/filestore": "^2.0.0" }, "devDependencies": { "c8": "^7.3.0", From 21e953a98745101a7f09c5c2c641a2245197c129 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:04:27 +0200 Subject: [PATCH 37/59] chore(deps): update dependency jsdoc-fresh to v2 (#69) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index da882394dee..b6712c90cb3 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 182a597121e8ac1cfc67ab6f5492c15c2cccf8de Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 10 Jun 2022 17:30:24 +0200 Subject: [PATCH 38/59] chore(deps): update dependency jsdoc-region-tag to v2 (#70) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index b6712c90cb3..ea9fcf442c5 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 9967bf9674442729b392ee496c67e22c5ef4f16c 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:10:46 -0700 Subject: [PATCH 39/59] feat: support regapic LRO (#71) 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/cloud_filestore_manager_client.ts | 53 ++++++++++++++----- .../v1beta1/cloud_filestore_manager_client.ts | 53 ++++++++++++++----- 2 files changed, 82 insertions(+), 24 deletions(-) diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 63cf537d1f6..47d7bf1b6d5 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -90,7 +91,7 @@ export class CloudFilestoreManagerClient { * * @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] @@ -113,11 +114,10 @@ export class CloudFilestoreManagerClient { * 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. @@ -213,16 +213,45 @@ export class CloudFilestoreManagerClient { }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); - // This API contains "long-running operations", which return a // an Operation object that allows for tracking of the operation, // rather than holding a request open. - + const lroOptions: GrpcClientOptions = { + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }; + if (opts.fallback === 'rest') { + lroOptions.protoJson = protoFilesRoot; + lroOptions.httpRules = [ + { + selector: 'google.cloud.location.Locations.GetLocation', + get: '/v1/{name=projects/*/locations/*}', + }, + { + selector: 'google.cloud.location.Locations.ListLocations', + get: '/v1/{name=projects/*}/locations', + }, + { + selector: 'google.longrunning.Operations.CancelOperation', + post: '/v1/{name=projects/*/locations/*/operations/*}:cancel', + body: '*', + }, + { + selector: 'google.longrunning.Operations.DeleteOperation', + delete: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.GetOperation', + get: '/v1/{name=projects/*/locations/*/operations/*}', + }, + { + selector: 'google.longrunning.Operations.ListOperations', + get: '/v1/{name=projects/*/locations/*}/operations', + }, + ]; + } this.operationsClient = this._gaxModule - .lro({ - auth: this.auth, - grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, - }) + .lro(lroOptions) .operationsClient(opts); const createInstanceResponse = protoFilesRoot.lookup( '.google.cloud.filestore.v1.Instance' diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 40da3dbaa7a..8f7850717a6 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -23,6 +23,7 @@ import { CallOptions, Descriptors, ClientOptions, + GrpcClientOptions, LROperation, PaginationCallback, GaxCall, @@ -93,7 +94,7 @@ export class CloudFilestoreManagerClient { * * @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] @@ -116,11 +117,10 @@ export class CloudFilestoreManagerClient { * 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. @@ -219,16 +219,45 @@ export class CloudFilestoreManagerClient { }; 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.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.filestore.v1beta1.Instance' From 0e6d572f0b5a1928bd88840d418b0741f486942c 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:18:21 +0000 Subject: [PATCH 40/59] chore(main): release 2.1.0 (#72) :robot: I have created a release *beep* *boop* --- ## [2.1.0](https://github.com/googleapis/nodejs-filestore/compare/v2.0.0...v2.1.0) (2022-06-30) ### Features * support regapic LRO ([#71](https://github.com/googleapis/nodejs-filestore/issues/71)) ([69dedbe](https://github.com/googleapis/nodejs-filestore/commit/69dedbeb0ba429dbb768b4823a53bab01caa3e7d)) --- 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-filestore/CHANGELOG.md | 7 +++++++ packages/google-cloud-filestore/package.json | 2 +- .../v1/snippet_metadata.google.cloud.filestore.v1.json | 2 +- .../snippet_metadata.google.cloud.filestore.v1beta1.json | 2 +- packages/google-cloud-filestore/samples/package.json | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 18474094cac..6a2359ffdd7 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.1.0](https://github.com/googleapis/nodejs-filestore/compare/v2.0.0...v2.1.0) (2022-06-30) + + +### Features + +* support regapic LRO ([#71](https://github.com/googleapis/nodejs-filestore/issues/71)) ([69dedbe](https://github.com/googleapis/nodejs-filestore/commit/69dedbeb0ba429dbb768b4823a53bab01caa3e7d)) + ## [2.0.0](https://github.com/googleapis/nodejs-filestore/compare/v1.1.2...v2.0.0) (2022-05-19) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index ea9fcf442c5..18ad029fb75 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "2.0.0", + "version": "2.1.0", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json index 06186218418..cab0260d63d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index 519df4ca124..263d8d394c1 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "2.0.0", + "version": "2.1.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index ca920147945..d6ab1ac50db 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^2.0.0" + "@google-cloud/filestore": "^2.1.0" }, "devDependencies": { "c8": "^7.3.0", From 1c85e743fb64f86c135302011a5d7f30da3700c8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Jul 2022 02:00:18 +0200 Subject: [PATCH 41/59] chore(deps): update dependency linkinator 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 | |---|---|---|---|---|---| | [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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 18ad029fb75..fced8668fa1 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 16b8271670161a19442efcabe3296f75bf646637 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:10:23 +0000 Subject: [PATCH 42/59] fix: better support for fallback mode (#77) - [ ] 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 --- .../cloud_filestore_manager.create_backup.js | 3 + ...cloud_filestore_manager.create_instance.js | 3 + .../cloud_filestore_manager.delete_backup.js | 3 + ...cloud_filestore_manager.delete_instance.js | 3 + .../v1/cloud_filestore_manager.get_backup.js | 3 + .../cloud_filestore_manager.get_instance.js | 3 + .../cloud_filestore_manager.list_backups.js | 3 + .../cloud_filestore_manager.list_instances.js | 3 + ...loud_filestore_manager.restore_instance.js | 3 + .../cloud_filestore_manager.update_backup.js | 3 + ...cloud_filestore_manager.update_instance.js | 3 + ...et_metadata.google.cloud.filestore.v1.json | 22 +-- .../cloud_filestore_manager.create_backup.js | 3 + ...cloud_filestore_manager.create_instance.js | 3 + .../cloud_filestore_manager.delete_backup.js | 3 + ...cloud_filestore_manager.delete_instance.js | 3 + .../cloud_filestore_manager.get_backup.js | 3 + .../cloud_filestore_manager.get_instance.js | 3 + .../cloud_filestore_manager.list_backups.js | 3 + .../cloud_filestore_manager.list_instances.js | 3 + ...loud_filestore_manager.restore_instance.js | 3 + .../cloud_filestore_manager.update_backup.js | 3 + ...cloud_filestore_manager.update_instance.js | 3 + ...tadata.google.cloud.filestore.v1beta1.json | 22 +-- .../src/v1/cloud_filestore_manager_client.ts | 26 +-- .../v1beta1/cloud_filestore_manager_client.ts | 26 +-- .../test/gapic_cloud_filestore_manager_v1.ts | 178 ++++++++--------- .../gapic_cloud_filestore_manager_v1beta1.ts | 182 +++++++++--------- 28 files changed, 296 insertions(+), 226 deletions(-) diff --git a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js index 522528ea9a2..a1f61a75bd8 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js @@ -23,6 +23,9 @@ function main(parent, backup, backupId) { // [START file_v1_generated_CloudFilestoreManager_CreateBackup_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-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js index f1ee31af676..2e7737982f8 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId, instance) { // [START file_v1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js index e7a3f857a5d..0ab3b8c2b9b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1_generated_CloudFilestoreManager_DeleteBackup_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-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js index 160d13046bd..deb4a52129b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js index dbf655241ca..8cbde7304d7 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1_generated_CloudFilestoreManager_GetBackup_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-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js index 64c7a269f81..a494686408e 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js index 37fe21306b2..fa20cb0b802 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js @@ -23,6 +23,9 @@ function main(parent) { // [START file_v1_generated_CloudFilestoreManager_ListBackups_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-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js index 800afa0218c..67d55401c2e 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START file_v1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js index 2be0689e19d..2c691937fc6 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js @@ -23,6 +23,9 @@ function main(name, fileShare) { // [START file_v1_generated_CloudFilestoreManager_RestoreInstance_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-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js index 153cf08ed8b..8457ab63a4c 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js @@ -23,6 +23,9 @@ function main(backup, updateMask) { // [START file_v1_generated_CloudFilestoreManager_UpdateBackup_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-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js index 80af3634128..a58df33a8d9 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js @@ -23,6 +23,9 @@ function main() { // [START file_v1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json index cab0260d63d..9959a93643a 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 64, + "end": 67, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 59, + "end": 62, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 63, + "end": 66, "type": "FULL" } ], @@ -258,7 +258,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -298,7 +298,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], @@ -354,7 +354,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -394,7 +394,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -442,7 +442,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -482,7 +482,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index 8a1d810399f..aa4b06a679b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -23,6 +23,9 @@ function main(parent, backup, backupId) { // [START file_v1beta1_generated_CloudFilestoreManager_CreateBackup_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index efd8d806f5b..62c0b12052c 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -23,6 +23,9 @@ function main(parent, instanceId, instance) { // [START file_v1beta1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js index 29babc4b0d9..c02be6c5b5d 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index 115388bfcbf..e6ce14ab7d1 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1beta1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js index 6a1ba8dcb04..c785a3781d7 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1beta1_generated_CloudFilestoreManager_GetBackup_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js index 5b1b616b021..cfd5079fb75 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js @@ -23,6 +23,9 @@ function main(name) { // [START file_v1beta1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 20b4215eab0..7869cd6805f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -23,6 +23,9 @@ function main(parent) { // [START file_v1beta1_generated_CloudFilestoreManager_ListBackups_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js index 550c331c3ce..80063ca8554 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js @@ -23,6 +23,9 @@ function main(parent) { // [START file_v1beta1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index feac01861bb..033044f5c2b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js @@ -23,6 +23,9 @@ function main(name, fileShare) { // [START file_v1beta1_generated_CloudFilestoreManager_RestoreInstance_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js index d1c471ad7fc..119c22dd2f4 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js @@ -23,6 +23,9 @@ function main(backup, updateMask) { // [START file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_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-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js index 176ad3d1cd0..d100b618398 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js @@ -23,6 +23,9 @@ function main(updateMask, instance) { // [START file_v1beta1_generated_CloudFilestoreManager_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-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index 263d8d394c1..5d7947cde17 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -22,7 +22,7 @@ "segments": [ { "start": 25, - "end": 73, + "end": 76, "type": "FULL" } ], @@ -78,7 +78,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -118,7 +118,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -166,7 +166,7 @@ "segments": [ { "start": 25, - "end": 61, + "end": 64, "type": "FULL" } ], @@ -210,7 +210,7 @@ "segments": [ { "start": 25, - "end": 68, + "end": 71, "type": "FULL" } ], @@ -262,7 +262,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -302,7 +302,7 @@ "segments": [ { "start": 25, - "end": 74, + "end": 77, "type": "FULL" } ], @@ -358,7 +358,7 @@ "segments": [ { "start": 25, - "end": 51, + "end": 54, "type": "FULL" } ], @@ -398,7 +398,7 @@ "segments": [ { "start": 25, - "end": 66, + "end": 69, "type": "FULL" } ], @@ -446,7 +446,7 @@ "segments": [ { "start": 25, - "end": 52, + "end": 55, "type": "FULL" } ], @@ -486,7 +486,7 @@ "segments": [ { "start": 25, - "end": 57, + "end": 60, "type": "FULL" } ], diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 47d7bf1b6d5..a225be52adb 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_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'); /** @@ -418,7 +417,8 @@ export class CloudFilestoreManagerClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -791,7 +791,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1.Instance, @@ -936,7 +936,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1.Instance, @@ -1084,7 +1084,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.restoreInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1.Instance, @@ -1222,7 +1222,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1371,7 +1371,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1.Backup, @@ -1509,7 +1509,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1649,7 +1649,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1.Backup, @@ -1812,7 +1812,7 @@ export class CloudFilestoreManagerClient { 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 ); @@ -1869,7 +1869,7 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2025,7 +2025,7 @@ export class CloudFilestoreManagerClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as gax.GaxCall, + this.innerApiCalls.listBackups as GaxCall, request, callSettings ); @@ -2083,7 +2083,7 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 8f7850717a6..a76fcc0df21 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_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 CloudFilestoreManagerClient { const apiCall = this._gaxModule.createApiCall( callPromise, this._defaults[methodName], - descriptor + descriptor, + this._opts.fallback ); this.innerApiCalls[methodName] = apiCall; @@ -815,7 +815,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1beta1.Instance, @@ -960,7 +960,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1beta1.Instance, @@ -1111,7 +1111,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.restoreInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1beta1.Instance, @@ -1249,7 +1249,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteInstance, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1396,7 +1396,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.createBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1beta1.Backup, @@ -1534,7 +1534,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.deleteBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.protobuf.Empty, @@ -1674,7 +1674,7 @@ export class CloudFilestoreManagerClient { const decodeOperation = new gax.Operation( operation, this.descriptors.longrunning.updateBackup, - gax.createDefaultBackoffSettings() + this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< protos.google.cloud.filestore.v1beta1.Backup, @@ -1837,7 +1837,7 @@ export class CloudFilestoreManagerClient { 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 ); @@ -1894,7 +1894,7 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.descriptors.page.listInstances.asyncIterate( this.innerApiCalls['listInstances'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } @@ -2056,7 +2056,7 @@ export class CloudFilestoreManagerClient { const callSettings = defaultCallSettings.merge(options); this.initialize(); return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as gax.GaxCall, + this.innerApiCalls.listBackups as GaxCall, request, callSettings ); @@ -2114,7 +2114,7 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.descriptors.page.listBackups.asyncIterate( this.innerApiCalls['listBackups'] as GaxCall, - request as unknown as RequestType, + request as {}, callSettings ) as AsyncIterable; } diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 914d07c4894..825d6e3b8f7 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -145,109 +145,111 @@ function stubAsyncIterationCall( } describe('v1.CloudFilestoreManagerClient', () => { - it('has servicePath', () => { - const servicePath = - cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudFilestoreManagerStub, undefined); - await client.initialize(); - assert(client.cloudFilestoreManagerStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + await client.initialize(); + assert(client.cloudFilestoreManagerStub); + }); - it('has close method for the initialized client', done => { - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.cloudFilestoreManagerStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.cloudFilestoreManagerStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ - 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 cloudfilestoremanagerModule.v1.CloudFilestoreManagerClient({ + 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-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index 06c84e5da31..b7eced66804 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -145,111 +145,113 @@ function stubAsyncIterationCall( } describe('v1beta1.CloudFilestoreManagerClient', () => { - it('has servicePath', () => { - const servicePath = - cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient - .servicePath; - assert(servicePath); - }); + describe('Common methods', () => { + it('has servicePath', () => { + const servicePath = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient + .servicePath; + assert(servicePath); + }); - it('has apiEndpoint', () => { - const apiEndpoint = - cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient - .apiEndpoint; - assert(apiEndpoint); - }); + it('has apiEndpoint', () => { + const apiEndpoint = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient + .apiEndpoint; + assert(apiEndpoint); + }); - it('has port', () => { - const port = - cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient.port; - assert(port); - assert(typeof port === 'number'); - }); + it('has port', () => { + const port = + cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient.port; + assert(port); + assert(typeof port === 'number'); + }); - it('should create a client with no option', () => { - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient(); - assert(client); - }); + it('should create a client with no option', () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient(); + assert(client); + }); - it('should create a client with gRPC fallback', () => { - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - fallback: true, - }); - assert(client); - }); + it('should create a client with gRPC fallback', () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + fallback: true, + }); + assert(client); + }); - it('has initialize method and supports deferred initialization', async () => { - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.cloudFilestoreManagerStub, undefined); - await client.initialize(); - assert(client.cloudFilestoreManagerStub); - }); + it('has initialize method and supports deferred initialization', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + await client.initialize(); + assert(client.cloudFilestoreManagerStub); + }); - it('has close method for the initialized client', done => { - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + assert(client.cloudFilestoreManagerStub); + client.close().then(() => { + done(); }); - client.initialize(); - assert(client.cloudFilestoreManagerStub); - client.close().then(() => { - done(); }); - }); - it('has close method for the non-initialized client', done => { - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', + it('has close method for the non-initialized client', done => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.cloudFilestoreManagerStub, undefined); + client.close().then(() => { + done(); }); - assert.strictEqual(client.cloudFilestoreManagerStub, undefined); - client.close().then(() => { - done(); }); - }); - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = - new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - 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', async () => { + const fakeProjectId = 'fake-project-id'; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ - 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 cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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 1a921f2d218d92c30aea6b1f155336db3f7bc8c0 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:36:33 +0000 Subject: [PATCH 43/59] fix: change import long to require (#78) Source-Link: https://github.com/googleapis/synthtool/commit/d229a1258999f599a90a9b674a1c5541e00db588 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:74ab2b3c71ef27e6d8b69b1d0a0c9d31447777b79ac3cd4be82c265b45f37e5e --- .../google-cloud-filestore/protos/protos.d.ts | 735 ++- .../google-cloud-filestore/protos/protos.js | 4520 ++++++++++++----- .../google-cloud-filestore/protos/protos.json | 24 + 3 files changed, 3913 insertions(+), 1366 deletions(-) diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index 51d28c70f08..61c13249432 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/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 { @@ -147,6 +147,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; } } @@ -334,77 +341,77 @@ export namespace google { namespace CloudFilestoreManager { /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listInstances}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.filestore.v1.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.filestore.v1.Instance) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|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.filestore.v1.CloudFilestoreManager#updateInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|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.filestore.v1.CloudFilestoreManager#restoreInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|restoreInstance}. * @param error Error, if any * @param [response] Operation */ type RestoreInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|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.filestore.v1.CloudFilestoreManager#listBackups}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|listBackups}. * @param error Error, if any * @param [response] ListBackupsResponse */ type ListBackupsCallback = (error: (Error|null), response?: google.cloud.filestore.v1.ListBackupsResponse) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|getBackup}. * @param error Error, if any * @param [response] Backup */ type GetBackupCallback = (error: (Error|null), response?: google.cloud.filestore.v1.Backup) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|createBackup}. * @param error Error, if any * @param [response] Operation */ type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|deleteBackup}. * @param error Error, if any * @param [response] Operation */ type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|updateBackup}. * @param error Error, if any * @param [response] Operation */ @@ -517,6 +524,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; } namespace NetworkConfig { @@ -637,6 +651,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileShareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a NfsExportOptions. */ @@ -751,6 +772,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NfsExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace NfsExportOptions { @@ -918,6 +946,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 { @@ -1044,6 +1079,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 GetInstanceRequest. */ @@ -1134,6 +1176,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 an UpdateInstanceRequest. */ @@ -1230,6 +1279,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 RestoreInstanceRequest. */ @@ -1335,6 +1391,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteInstanceRequest. */ @@ -1425,6 +1488,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 a ListInstancesRequest. */ @@ -1539,6 +1609,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. */ @@ -1641,6 +1718,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 Backup. */ @@ -1797,6 +1881,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Backup { @@ -1911,6 +2002,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteBackupRequest. */ @@ -2001,6 +2099,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateBackupRequest. */ @@ -2097,6 +2202,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetBackupRequest. */ @@ -2187,6 +2299,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBackupsRequest. */ @@ -2301,6 +2420,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBackupsResponse. */ @@ -2403,6 +2529,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -2587,77 +2720,77 @@ export namespace google { namespace CloudFilestoreManager { /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listInstances}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listInstances}. * @param error Error, if any * @param [response] ListInstancesResponse */ type ListInstancesCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListInstancesResponse) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getInstance}. * @param error Error, if any * @param [response] Instance */ type GetInstanceCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Instance) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|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.filestore.v1beta1.CloudFilestoreManager#updateInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|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.filestore.v1beta1.CloudFilestoreManager#restoreInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|restoreInstance}. * @param error Error, if any * @param [response] Operation */ type RestoreInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|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.filestore.v1beta1.CloudFilestoreManager#listBackups}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listBackups}. * @param error Error, if any * @param [response] ListBackupsResponse */ type ListBackupsCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListBackupsResponse) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getBackup}. * @param error Error, if any * @param [response] Backup */ type GetBackupCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Backup) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createBackup}. * @param error Error, if any * @param [response] Operation */ type CreateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteBackup}. * @param error Error, if any * @param [response] Operation */ type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateBackup}. * @param error Error, if any * @param [response] Operation */ @@ -2770,6 +2903,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; } namespace NetworkConfig { @@ -2890,6 +3030,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileShareConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a NfsExportOptions. */ @@ -3004,6 +3151,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NfsExportOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace NfsExportOptions { @@ -3171,6 +3325,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 { @@ -3297,6 +3458,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 GetInstanceRequest. */ @@ -3387,6 +3555,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 an UpdateInstanceRequest. */ @@ -3483,6 +3658,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 RestoreInstanceRequest. */ @@ -3594,6 +3776,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteInstanceRequest. */ @@ -3684,6 +3873,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 a ListInstancesRequest. */ @@ -3798,6 +3994,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. */ @@ -3900,6 +4103,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 Snapshot. */ @@ -4020,6 +4230,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Snapshot + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Snapshot { @@ -4187,6 +4404,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } namespace Backup { @@ -4301,6 +4525,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a DeleteBackupRequest. */ @@ -4391,6 +4622,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an UpdateBackupRequest. */ @@ -4487,6 +4725,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a GetBackupRequest. */ @@ -4577,6 +4822,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBackupsRequest. */ @@ -4691,6 +4943,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a ListBackupsResponse. */ @@ -4793,6 +5052,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } } @@ -4907,6 +5173,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. */ @@ -5054,6 +5327,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. */ @@ -5150,6 +5430,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; } /** Properties of a ResourceDescriptor. */ @@ -5276,6 +5563,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 { @@ -5388,6 +5682,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; } } @@ -5482,6 +5783,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. */ @@ -5522,6 +5830,9 @@ export namespace google { /** FileDescriptorProto syntax */ syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (string|null); } /** Represents a FileDescriptorProto. */ @@ -5569,6 +5880,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 @@ -5638,6 +5952,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. */ @@ -5782,6 +6103,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 { @@ -5886,6 +6214,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. */ @@ -5982,6 +6317,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; } } @@ -6073,6 +6415,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. */ @@ -6223,6 +6572,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 { @@ -6351,6 +6707,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. */ @@ -6465,6 +6828,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 { @@ -6563,6 +6933,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; } } @@ -6666,6 +7043,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. */ @@ -6768,6 +7152,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. */ @@ -6888,6 +7279,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. */ @@ -7101,6 +7499,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 { @@ -7228,6 +7633,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. */ @@ -7245,6 +7657,9 @@ export namespace google { /** FieldOptions lazy */ lazy?: (boolean|null); + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + /** FieldOptions deprecated */ deprecated?: (boolean|null); @@ -7282,6 +7697,9 @@ export namespace google { /** FieldOptions lazy. */ public lazy: boolean; + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + /** FieldOptions deprecated. */ public deprecated: boolean; @@ -7360,6 +7778,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 { @@ -7467,6 +7892,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. */ @@ -7569,6 +8001,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. */ @@ -7665,6 +8104,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. */ @@ -7767,6 +8213,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. */ @@ -7878,6 +8331,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 { @@ -8014,6 +8474,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 { @@ -8112,6 +8579,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; } } @@ -8203,6 +8677,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 { @@ -8319,6 +8800,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; } } @@ -8410,6 +8898,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 { @@ -8428,6 +8923,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. */ @@ -8451,6 +8949,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 @@ -8520,6 +9021,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 + } } } @@ -8617,6 +9135,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; } /** Properties of an Any. */ @@ -8713,6 +9238,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. */ @@ -8809,6 +9341,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. */ @@ -8893,6 +9432,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. */ @@ -8983,6 +9529,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 DoubleValue. */ @@ -9073,6 +9626,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DoubleValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a FloatValue. */ @@ -9163,6 +9723,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FloatValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Int64Value. */ @@ -9253,6 +9820,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UInt64Value. */ @@ -9343,6 +9917,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt64Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of an Int32Value. */ @@ -9433,6 +10014,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Int32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a UInt32Value. */ @@ -9523,6 +10111,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UInt32Value + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BoolValue. */ @@ -9613,6 +10208,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BoolValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a StringValue. */ @@ -9703,6 +10305,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StringValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } /** Properties of a BytesValue. */ @@ -9793,6 +10402,13 @@ export namespace google { * @returns JSON object */ public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BytesValue + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } } @@ -9893,35 +10509,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 */ @@ -10043,6 +10659,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. */ @@ -10133,6 +10756,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. */ @@ -10241,6 +10871,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. */ @@ -10337,6 +10974,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. */ @@ -10427,6 +11071,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. */ @@ -10517,6 +11168,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. */ @@ -10613,6 +11271,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. */ @@ -10709,6 +11374,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; } } @@ -10815,6 +11487,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; } } } diff --git a/packages/google-cloud-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index c274bb04e5a..4d7c72ae3e9 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/protos/protos.js @@ -215,27 +215,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.cancelRequested = 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.cancelRequested = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -384,6 +391,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.common.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.common.OperationMetadata"; + }; + return OperationMetadata; })(); @@ -441,7 +463,7 @@ }; /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listInstances}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|listInstances}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef ListInstancesCallback * @type {function} @@ -474,7 +496,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|getInstance}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef GetInstanceCallback * @type {function} @@ -507,7 +529,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|createInstance}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef CreateInstanceCallback * @type {function} @@ -540,7 +562,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|updateInstance}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef UpdateInstanceCallback * @type {function} @@ -573,7 +595,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#restoreInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|restoreInstance}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef RestoreInstanceCallback * @type {function} @@ -606,7 +628,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteInstance}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|deleteInstance}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef DeleteInstanceCallback * @type {function} @@ -639,7 +661,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#listBackups}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|listBackups}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef ListBackupsCallback * @type {function} @@ -672,7 +694,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#getBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|getBackup}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef GetBackupCallback * @type {function} @@ -705,7 +727,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#createBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|createBackup}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef CreateBackupCallback * @type {function} @@ -738,7 +760,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#deleteBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|deleteBackup}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef DeleteBackupCallback * @type {function} @@ -771,7 +793,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager#updateBackup}. + * Callback as used by {@link google.cloud.filestore.v1.CloudFilestoreManager|updateBackup}. * @memberof google.cloud.filestore.v1.CloudFilestoreManager * @typedef UpdateBackupCallback * @type {function} @@ -938,27 +960,31 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.network = reader.string(); - break; - case 3: - if (!(message.modes && message.modes.length)) - message.modes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.network = reader.string(); + break; + } + case 3: { + if (!(message.modes && message.modes.length)) + message.modes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modes.push(reader.int32()); + } else message.modes.push(reader.int32()); - } else - message.modes.push(reader.int32()); - break; - case 4: - message.reservedIpRange = reader.string(); - break; - case 5: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; + break; + } + case 4: { + message.reservedIpRange = reader.string(); + break; + } + case 5: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -1114,6 +1140,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.NetworkConfig"; + }; + /** * AddressMode enum. * @name google.cloud.filestore.v1.NetworkConfig.AddressMode @@ -1272,20 +1313,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.capacityGb = reader.int64(); - break; - case 8: - message.sourceBackup = reader.string(); - break; - case 7: - if (!(message.nfsExportOptions && message.nfsExportOptions.length)) - message.nfsExportOptions = []; - message.nfsExportOptions.push($root.google.cloud.filestore.v1.NfsExportOptions.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.capacityGb = reader.int64(); + break; + } + case 8: { + message.sourceBackup = reader.string(); + break; + } + case 7: { + if (!(message.nfsExportOptions && message.nfsExportOptions.length)) + message.nfsExportOptions = []; + message.nfsExportOptions.push($root.google.cloud.filestore.v1.NfsExportOptions.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -1437,6 +1482,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileShareConfig + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.FileShareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileShareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.FileShareConfig"; + }; + return FileShareConfig; })(); @@ -1578,23 +1638,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.ipRanges && message.ipRanges.length)) - message.ipRanges = []; - message.ipRanges.push(reader.string()); - break; - case 2: - message.accessMode = reader.int32(); - break; - case 3: - message.squashMode = reader.int32(); - break; - case 4: - message.anonUid = reader.int64(); - break; - case 5: - message.anonGid = reader.int64(); - break; + case 1: { + if (!(message.ipRanges && message.ipRanges.length)) + message.ipRanges = []; + message.ipRanges.push(reader.string()); + break; + } + case 2: { + message.accessMode = reader.int32(); + break; + } + case 3: { + message.squashMode = reader.int32(); + break; + } + case 4: { + message.anonUid = reader.int64(); + break; + } + case 5: { + message.anonGid = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -1794,6 +1859,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NfsExportOptions + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.NfsExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NfsExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.NfsExportOptions"; + }; + /** * AccessMode enum. * @name google.cloud.filestore.v1.NfsExportOptions.AccessMode @@ -2037,62 +2117,73 @@ 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 5: - message.state = reader.int32(); - break; - case 6: - message.statusMessage = reader.string(); - break; - case 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.tier = reader.int32(); - break; - case 9: - 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 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.statusMessage = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.tier = reader.int32(); + break; + } + case 9: { + 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 10: { + if (!(message.fileShares && message.fileShares.length)) + message.fileShares = []; + message.fileShares.push($root.google.cloud.filestore.v1.FileShareConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.filestore.v1.NetworkConfig.decode(reader, reader.uint32())); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 13: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 10: - if (!(message.fileShares && message.fileShares.length)) - message.fileShares = []; - message.fileShares.push($root.google.cloud.filestore.v1.FileShareConfig.decode(reader, reader.uint32())); - break; - case 11: - if (!(message.networks && message.networks.length)) - message.networks = []; - message.networks.push($root.google.cloud.filestore.v1.NetworkConfig.decode(reader, reader.uint32())); - break; - case 12: - message.etag = reader.string(); - break; - case 13: - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -2395,6 +2486,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.Instance"; + }; + /** * State enum. * @name google.cloud.filestore.v1.Instance.State @@ -2558,15 +2664,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.filestore.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.filestore.v1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -2678,6 +2787,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -2773,9 +2897,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; @@ -2865,6 +2990,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.GetInstanceRequest"; + }; + return GetInstanceRequest; })(); @@ -2971,12 +3111,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 2: - message.instance = $root.google.cloud.filestore.v1.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.filestore.v1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -3085,6 +3227,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -3216,15 +3373,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.fileShare = reader.string(); - break; - case 3: - message.sourceBackup = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fileShare = reader.string(); + break; + } + case 3: { + message.sourceBackup = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3336,6 +3496,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestoreInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.RestoreInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.RestoreInstanceRequest"; + }; + return RestoreInstanceRequest; })(); @@ -3431,9 +3606,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; @@ -3523,6 +3699,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -3662,21 +3853,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.orderBy = reader.string(); - break; - case 5: - message.filter = 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -3799,8 +3995,23 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListInstancesRequest; - })(); + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.ListInstancesRequest"; + }; + + return ListInstancesRequest; + })(); v1.ListInstancesResponse = (function() { @@ -3920,19 +4131,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.filestore.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.filestore.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; @@ -4069,6 +4283,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -4287,61 +4516,73 @@ 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.state = reader.int32(); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - 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.state = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } } + message.labels[key] = value; + break; + } + case 6: { + message.capacityGb = reader.int64(); + break; + } + case 7: { + message.storageBytes = reader.int64(); + break; + } + case 8: { + message.sourceInstance = reader.string(); + break; + } + case 9: { + message.sourceFileShare = reader.string(); + break; + } + case 10: { + message.sourceInstanceTier = reader.int32(); + break; + } + case 11: { + message.downloadBytes = reader.int64(); + break; + } + case 12: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 6: - message.capacityGb = reader.int64(); - break; - case 7: - message.storageBytes = reader.int64(); - break; - case 8: - message.sourceInstance = reader.string(); - break; - case 9: - message.sourceFileShare = reader.string(); - break; - case 10: - message.sourceInstanceTier = reader.int32(); - break; - case 11: - message.downloadBytes = reader.int64(); - break; - case 12: - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -4648,6 +4889,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.Backup"; + }; + /** * State enum. * @name google.cloud.filestore.v1.Backup.State @@ -4785,15 +5041,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.backup = $root.google.cloud.filestore.v1.Backup.decode(reader, reader.uint32()); - break; - case 3: - message.backupId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backup = $root.google.cloud.filestore.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -4905,6 +5164,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.CreateBackupRequest"; + }; + return CreateBackupRequest; })(); @@ -5000,9 +5274,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; @@ -5092,6 +5367,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.DeleteBackupRequest"; + }; + return DeleteBackupRequest; })(); @@ -5198,12 +5488,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.backup = $root.google.cloud.filestore.v1.Backup.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.backup = $root.google.cloud.filestore.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -5312,6 +5604,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.UpdateBackupRequest"; + }; + return UpdateBackupRequest; })(); @@ -5407,9 +5714,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; @@ -5499,6 +5807,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.GetBackupRequest"; + }; + return GetBackupRequest; })(); @@ -5638,21 +5961,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.orderBy = reader.string(); - break; - case 5: - message.filter = 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -5775,6 +6103,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.ListBackupsRequest"; + }; + return ListBackupsRequest; })(); @@ -5896,19 +6239,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.filestore.v1.Backup.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.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.filestore.v1.Backup.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; @@ -6045,6 +6391,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1.ListBackupsResponse"; + }; + return ListBackupsResponse; })(); @@ -6093,7 +6454,7 @@ }; /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listInstances}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listInstances}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef ListInstancesCallback * @type {function} @@ -6126,7 +6487,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef GetInstanceCallback * @type {function} @@ -6159,7 +6520,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef CreateInstanceCallback * @type {function} @@ -6192,7 +6553,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef UpdateInstanceCallback * @type {function} @@ -6225,7 +6586,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#restoreInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|restoreInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef RestoreInstanceCallback * @type {function} @@ -6258,7 +6619,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteInstance}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef DeleteInstanceCallback * @type {function} @@ -6291,7 +6652,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#listBackups}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listBackups}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef ListBackupsCallback * @type {function} @@ -6324,7 +6685,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#getBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getBackup}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef GetBackupCallback * @type {function} @@ -6357,7 +6718,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#createBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createBackup}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef CreateBackupCallback * @type {function} @@ -6390,7 +6751,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#deleteBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteBackup}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef DeleteBackupCallback * @type {function} @@ -6423,7 +6784,7 @@ */ /** - * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager#updateBackup}. + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateBackup}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager * @typedef UpdateBackupCallback * @type {function} @@ -6590,27 +6951,31 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.network = reader.string(); - break; - case 3: - if (!(message.modes && message.modes.length)) - message.modes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) + case 1: { + message.network = reader.string(); + break; + } + case 3: { + if (!(message.modes && message.modes.length)) + message.modes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.modes.push(reader.int32()); + } else message.modes.push(reader.int32()); - } else - message.modes.push(reader.int32()); - break; - case 4: - message.reservedIpRange = reader.string(); - break; - case 5: - if (!(message.ipAddresses && message.ipAddresses.length)) - message.ipAddresses = []; - message.ipAddresses.push(reader.string()); - break; + break; + } + case 4: { + message.reservedIpRange = reader.string(); + break; + } + case 5: { + if (!(message.ipAddresses && message.ipAddresses.length)) + message.ipAddresses = []; + message.ipAddresses.push(reader.string()); + break; + } default: reader.skipType(tag & 7); break; @@ -6766,6 +7131,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.NetworkConfig"; + }; + /** * AddressMode enum. * @name google.cloud.filestore.v1beta1.NetworkConfig.AddressMode @@ -6924,20 +7304,24 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.capacityGb = reader.int64(); - break; - case 9: - message.sourceBackup = reader.string(); - break; - case 8: - if (!(message.nfsExportOptions && message.nfsExportOptions.length)) - message.nfsExportOptions = []; - message.nfsExportOptions.push($root.google.cloud.filestore.v1beta1.NfsExportOptions.decode(reader, reader.uint32())); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.capacityGb = reader.int64(); + break; + } + case 9: { + message.sourceBackup = reader.string(); + break; + } + case 8: { + if (!(message.nfsExportOptions && message.nfsExportOptions.length)) + message.nfsExportOptions = []; + message.nfsExportOptions.push($root.google.cloud.filestore.v1beta1.NfsExportOptions.decode(reader, reader.uint32())); + break; + } default: reader.skipType(tag & 7); break; @@ -7089,6 +7473,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FileShareConfig + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.FileShareConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileShareConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.FileShareConfig"; + }; + return FileShareConfig; })(); @@ -7230,23 +7629,28 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.ipRanges && message.ipRanges.length)) - message.ipRanges = []; - message.ipRanges.push(reader.string()); - break; - case 2: - message.accessMode = reader.int32(); - break; - case 3: - message.squashMode = reader.int32(); - break; - case 4: - message.anonUid = reader.int64(); - break; - case 5: - message.anonGid = reader.int64(); - break; + case 1: { + if (!(message.ipRanges && message.ipRanges.length)) + message.ipRanges = []; + message.ipRanges.push(reader.string()); + break; + } + case 2: { + message.accessMode = reader.int32(); + break; + } + case 3: { + message.squashMode = reader.int32(); + break; + } + case 4: { + message.anonUid = reader.int64(); + break; + } + case 5: { + message.anonGid = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -7447,12 +7851,27 @@ }; /** - * AccessMode enum. - * @name google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode - * @enum {number} - * @property {number} ACCESS_MODE_UNSPECIFIED=0 ACCESS_MODE_UNSPECIFIED value - * @property {number} READ_ONLY=1 READ_ONLY value - * @property {number} READ_WRITE=2 READ_WRITE value + * Gets the default type url for NfsExportOptions + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.NfsExportOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NfsExportOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.NfsExportOptions"; + }; + + /** + * AccessMode enum. + * @name google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode + * @enum {number} + * @property {number} ACCESS_MODE_UNSPECIFIED=0 ACCESS_MODE_UNSPECIFIED value + * @property {number} READ_ONLY=1 READ_ONLY value + * @property {number} READ_WRITE=2 READ_WRITE value */ NfsExportOptions.AccessMode = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -7689,62 +8108,73 @@ 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 5: - message.state = reader.int32(); - break; - case 6: - message.statusMessage = reader.string(); - break; - case 7: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 8: - message.tier = reader.int32(); - break; - case 9: - 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 5: { + message.state = reader.int32(); + break; + } + case 6: { + message.statusMessage = reader.string(); + break; + } + case 7: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 8: { + message.tier = reader.int32(); + break; + } + case 9: { + 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 10: { + if (!(message.fileShares && message.fileShares.length)) + message.fileShares = []; + message.fileShares.push($root.google.cloud.filestore.v1beta1.FileShareConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.filestore.v1beta1.NetworkConfig.decode(reader, reader.uint32())); + break; + } + case 12: { + message.etag = reader.string(); + break; + } + case 13: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; } - message.labels[key] = value; - break; - case 10: - if (!(message.fileShares && message.fileShares.length)) - message.fileShares = []; - message.fileShares.push($root.google.cloud.filestore.v1beta1.FileShareConfig.decode(reader, reader.uint32())); - break; - case 11: - if (!(message.networks && message.networks.length)) - message.networks = []; - message.networks.push($root.google.cloud.filestore.v1beta1.NetworkConfig.decode(reader, reader.uint32())); - break; - case 12: - message.etag = reader.string(); - break; - case 13: - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -8047,6 +8477,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Instance + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.Instance"; + }; + /** * State enum. * @name google.cloud.filestore.v1beta1.Instance.State @@ -8210,15 +8655,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.filestore.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.filestore.v1beta1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8330,6 +8778,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.CreateInstanceRequest"; + }; + return CreateInstanceRequest; })(); @@ -8425,9 +8888,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; @@ -8517,6 +8981,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.GetInstanceRequest"; + }; + return GetInstanceRequest; })(); @@ -8623,12 +9102,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 2: - message.instance = $root.google.cloud.filestore.v1beta1.Instance.decode(reader, reader.uint32()); - break; + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.instance = $root.google.cloud.filestore.v1beta1.Instance.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -8737,6 +9218,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.UpdateInstanceRequest"; + }; + return UpdateInstanceRequest; })(); @@ -8879,18 +9375,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.fileShare = reader.string(); - break; - case 3: - message.sourceSnapshot = reader.string(); - break; - case 4: - message.sourceBackup = reader.string(); - break; + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.fileShare = reader.string(); + break; + } + case 3: { + message.sourceSnapshot = reader.string(); + break; + } + case 4: { + message.sourceBackup = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9016,6 +9516,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for RestoreInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.RestoreInstanceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.RestoreInstanceRequest"; + }; + return RestoreInstanceRequest; })(); @@ -9111,9 +9626,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; @@ -9203,6 +9719,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest"; + }; + return DeleteInstanceRequest; })(); @@ -9342,21 +9873,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.orderBy = reader.string(); - break; - case 5: - message.filter = 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9479,6 +10015,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.ListInstancesRequest"; + }; + return ListInstancesRequest; })(); @@ -9600,19 +10151,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.filestore.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.filestore.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; @@ -9749,6 +10303,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListInstancesResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.ListInstancesResponse"; + }; + return ListInstancesResponse; })(); @@ -9901,43 +10470,49 @@ 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.state = reader.int32(); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - 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.state = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + 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 12: { + message.filesystemUsedBytes = reader.int64(); + break; } - message.labels[key] = value; - break; - case 12: - message.filesystemUsedBytes = reader.int64(); - break; default: reader.skipType(tag & 7); break; @@ -10125,6 +10700,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Snapshot + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.Snapshot + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Snapshot.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.Snapshot"; + }; + /** * State enum. * @name google.cloud.filestore.v1beta1.Snapshot.State @@ -10361,63 +10951,75 @@ 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.state = reader.int32(); - break; - case 4: - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 5: - 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.state = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + 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 6: - message.capacityGb = reader.int64(); - break; - case 7: - message.storageBytes = reader.int64(); - break; - case 8: - message.sourceInstance = reader.string(); - break; - case 9: - message.sourceFileShare = reader.string(); - break; - case 10: - message.sourceInstanceTier = reader.int32(); - break; - case 11: - message.downloadBytes = reader.int64(); - break; - case 12: - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); + case 6: { + message.capacityGb = reader.int64(); + break; + } + case 7: { + message.storageBytes = reader.int64(); + break; + } + case 8: { + message.sourceInstance = reader.string(); + break; + } + case 9: { + message.sourceFileShare = reader.string(); + break; + } + case 10: { + message.sourceInstanceTier = reader.int32(); + break; + } + case 11: { + message.downloadBytes = reader.int64(); + break; + } + case 12: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); break; } } @@ -10722,6 +11324,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.Backup"; + }; + /** * State enum. * @name google.cloud.filestore.v1beta1.Backup.State @@ -10859,15 +11476,18 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); - break; - case 3: - message.backupId = reader.string(); - break; + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -10979,6 +11599,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.CreateBackupRequest"; + }; + return CreateBackupRequest; })(); @@ -11074,9 +11709,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; @@ -11166,6 +11802,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteBackupRequest"; + }; + return DeleteBackupRequest; })(); @@ -11272,12 +11923,14 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; + case 1: { + message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } default: reader.skipType(tag & 7); break; @@ -11386,6 +12039,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.UpdateBackupRequest"; + }; + return UpdateBackupRequest; })(); @@ -11481,9 +12149,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; @@ -11573,6 +12242,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.GetBackupRequest"; + }; + return GetBackupRequest; })(); @@ -11712,21 +12396,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.orderBy = reader.string(); - break; - case 5: - message.filter = 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -11849,6 +12538,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsRequest"; + }; + return ListBackupsRequest; })(); @@ -11970,19 +12674,22 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.filestore.v1beta1.Backup.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.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.filestore.v1beta1.Backup.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; @@ -12119,6 +12826,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsResponse"; + }; + return ListBackupsResponse; })(); @@ -12271,14 +12993,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; @@ -12394,6 +13118,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; })(); @@ -12604,38 +13343,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; @@ -12857,6 +13606,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; })(); @@ -12963,12 +13727,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; @@ -13067,6 +13833,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; })(); @@ -13235,36 +14016,43 @@ 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) + 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()); - } else - message.style.push(reader.int32()); - break; + break; + } default: reader.skipType(tag & 7); break; @@ -13462,6 +14250,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 @@ -13598,12 +14401,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; @@ -13702,6 +14507,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; })(); @@ -13811,11 +14631,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; @@ -13922,8 +14743,23 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return FileDescriptorSet; - })(); + /** + * Gets the default type url for FileDescriptorSet + * @function getTypeUrl + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FileDescriptorSet"; + }; + + return FileDescriptorSet; + })(); protobuf.FileDescriptorProto = (function() { @@ -13943,6 +14779,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 */ /** @@ -14063,6 +14900,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 @@ -14118,6 +14963,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; }; @@ -14152,66 +14999,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; @@ -14323,6 +15186,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; }; @@ -14415,6 +15281,8 @@ } if (object.syntax != null) message.syntax = String(object.syntax); + if (object.edition != null) + message.edition = String(object.edition); return message; }; @@ -14446,6 +15314,7 @@ object.options = null; object.sourceCodeInfo = null; object.syntax = ""; + object.edition = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -14492,6 +15361,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; }; @@ -14506,6 +15377,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; })(); @@ -14716,52 +15602,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; @@ -15062,6 +15958,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() { /** @@ -15176,15 +16087,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; @@ -15296,6 +16210,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; })(); @@ -15402,12 +16331,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; @@ -15506,6 +16437,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; })(); @@ -15606,11 +16552,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; @@ -15717,6 +16664,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; })(); @@ -15922,39 +16884,50 @@ 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; + 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; @@ -16241,6 +17214,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 @@ -16409,12 +17397,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; @@ -16518,6 +17508,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; })(); @@ -16663,27 +17668,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; @@ -16859,6 +17869,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() { /** @@ -16962,12 +17987,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; @@ -17066,6 +18093,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; })(); @@ -17186,15 +18228,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; @@ -17306,6 +18351,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; })(); @@ -17425,17 +18485,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; @@ -17565,6 +18628,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; })(); @@ -17715,24 +18793,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; @@ -17868,6 +18952,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; })(); @@ -18198,76 +19297,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; @@ -18580,6 +19701,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 @@ -18748,26 +19884,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; @@ -18921,6 +20063,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; })(); @@ -18934,6 +20091,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 @@ -18990,6 +20148,14 @@ */ FieldOptions.prototype.lazy = false; + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + /** * FieldOptions deprecated. * @member {boolean} deprecated @@ -19066,6 +20232,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(); @@ -19111,42 +20279,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; @@ -19206,6 +20387,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"; @@ -19291,6 +20475,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) @@ -19378,6 +20564,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")) @@ -19392,6 +20579,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) @@ -19418,6 +20607,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 @@ -19547,11 +20751,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; @@ -19658,6 +20863,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; })(); @@ -19777,17 +20997,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; @@ -19912,6 +21135,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; })(); @@ -20020,14 +21258,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; @@ -20143,6 +21383,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; })(); @@ -20273,20 +21528,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; @@ -20412,11 +21671,26 @@ * Converts this ServiceOptions to JSON. * @function toJSON * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceOptions + * @function getTypeUrl + * @memberof google.protobuf.ServiceOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.ServiceOptions"; }; return ServiceOptions; @@ -20573,28 +21847,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; @@ -20784,6 +22064,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 @@ -20963,29 +22258,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; @@ -21098,7 +22400,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); @@ -21179,6 +22481,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() { /** @@ -21280,12 +22597,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; @@ -21386,6 +22705,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; })(); @@ -21486,11 +22820,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; @@ -21597,6 +22932,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() { /** @@ -21745,37 +23095,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; @@ -21936,6 +23291,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; })(); @@ -22036,11 +23406,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; @@ -22147,6 +23518,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() { /** @@ -22157,6 +23543,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 */ /** @@ -22207,6 +23594,14 @@ */ Annotation.prototype.end = 0; + /** + * Annotation semantic. + * @member {google.protobuf.GeneratedCodeInfo.Annotation.Semantic} semantic + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.semantic = 0; + /** * Creates a new Annotation instance using the specified properties. * @function create @@ -22243,6 +23638,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; }; @@ -22277,25 +23674,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; @@ -22347,6 +23752,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; }; @@ -22375,6 +23789,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; }; @@ -22397,6 +23825,7 @@ object.sourceFile = ""; object.begin = 0; object.end = 0; + object.semantic = options.enums === String ? "NONE" : 0; } if (message.path && message.path.length) { object.path = []; @@ -22409,6 +23838,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; }; @@ -22423,6 +23854,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; })(); @@ -22532,12 +23994,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; @@ -22650,6 +24114,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; })(); @@ -22756,12 +24235,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; @@ -22823,7 +24304,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; }; @@ -22869,6 +24350,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; })(); @@ -22975,12 +24471,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; @@ -23093,6 +24591,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; })(); @@ -23253,6 +24766,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; })(); @@ -23349,12 +24877,13 @@ 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; + 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; @@ -23456,6 +24985,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; })(); @@ -23551,9 +25095,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.double(); - break; + case 1: { + message.value = reader.double(); + break; + } default: reader.skipType(tag & 7); break; @@ -23643,6 +25188,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for DoubleValue + * @function getTypeUrl + * @memberof google.protobuf.DoubleValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DoubleValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.DoubleValue"; + }; + return DoubleValue; })(); @@ -23738,9 +25298,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.float(); - break; + case 1: { + message.value = reader.float(); + break; + } default: reader.skipType(tag & 7); break; @@ -23830,6 +25391,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for FloatValue + * @function getTypeUrl + * @memberof google.protobuf.FloatValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FloatValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FloatValue"; + }; + return FloatValue; })(); @@ -23925,9 +25501,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.int64(); - break; + case 1: { + message.value = reader.int64(); + break; + } default: reader.skipType(tag & 7); break; @@ -24031,6 +25608,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Int64Value + * @function getTypeUrl + * @memberof google.protobuf.Int64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int64Value"; + }; + return Int64Value; })(); @@ -24126,9 +25718,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.uint64(); - break; + case 1: { + message.value = reader.uint64(); + break; + } default: reader.skipType(tag & 7); break; @@ -24232,6 +25825,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UInt64Value + * @function getTypeUrl + * @memberof google.protobuf.UInt64Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt64Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt64Value"; + }; + return UInt64Value; })(); @@ -24327,9 +25935,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.int32(); - break; + case 1: { + message.value = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24419,6 +26028,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for Int32Value + * @function getTypeUrl + * @memberof google.protobuf.Int32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Int32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.Int32Value"; + }; + return Int32Value; })(); @@ -24514,9 +26138,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.uint32(); - break; + case 1: { + message.value = reader.uint32(); + break; + } default: reader.skipType(tag & 7); break; @@ -24606,6 +26231,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for UInt32Value + * @function getTypeUrl + * @memberof google.protobuf.UInt32Value + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UInt32Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.UInt32Value"; + }; + return UInt32Value; })(); @@ -24701,9 +26341,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.bool(); - break; + case 1: { + message.value = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -24793,6 +26434,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BoolValue + * @function getTypeUrl + * @memberof google.protobuf.BoolValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BoolValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BoolValue"; + }; + return BoolValue; })(); @@ -24888,9 +26544,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; + case 1: { + message.value = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -24980,6 +26637,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for StringValue + * @function getTypeUrl + * @memberof google.protobuf.StringValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StringValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.StringValue"; + }; + return StringValue; })(); @@ -25075,9 +26747,10 @@ while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.value = reader.bytes(); - break; + case 1: { + message.value = reader.bytes(); + break; + } default: reader.skipType(tag & 7); break; @@ -25134,7 +26807,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; }; @@ -25176,6 +26849,21 @@ return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; + /** + * Gets the default type url for BytesValue + * @function getTypeUrl + * @memberof google.protobuf.BytesValue + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BytesValue.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.BytesValue"; + }; + return BytesValue; })(); @@ -25224,7 +26912,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} @@ -25257,7 +26945,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} @@ -25290,7 +26978,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} @@ -25323,7 +27011,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} @@ -25356,7 +27044,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} @@ -25541,21 +27229,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; @@ -25706,6 +27399,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; })(); @@ -25801,9 +27509,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; @@ -25893,6 +27602,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; })(); @@ -26021,18 +27745,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; @@ -26147,6 +27875,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; })(); @@ -26255,14 +27998,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; @@ -26378,6 +28123,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; })(); @@ -26473,9 +28233,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; @@ -26565,6 +28326,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; })(); @@ -26660,9 +28436,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; @@ -26752,6 +28529,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; })(); @@ -26858,12 +28650,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; @@ -26967,6 +28761,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; })(); @@ -27073,12 +28882,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; @@ -27177,6 +28988,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; })(); @@ -27308,17 +29134,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; @@ -27443,6 +29272,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; })(); diff --git a/packages/google-cloud-filestore/protos/protos.json b/packages/google-cloud-filestore/protos/protos.json index 6c6c67956e3..7552cc6a6bc 100644 --- a/packages/google-cloud-filestore/protos/protos.json +++ b/packages/google-cloud-filestore/protos/protos.json @@ -2089,6 +2089,10 @@ "syntax": { "type": "string", "id": 12 + }, + "edition": { + "type": "string", + "id": 13 } } }, @@ -2617,6 +2621,13 @@ "default": false } }, + "unverifiedLazy": { + "type": "bool", + "id": 15, + "options": { + "default": false + } + }, "deprecated": { "type": "bool", "id": 3, @@ -2909,6 +2920,19 @@ "end": { "type": "int32", "id": 4 + }, + "semantic": { + "type": "Semantic", + "id": 5 + } + }, + "nested": { + "Semantic": { + "values": { + "NONE": 0, + "SET": 1, + "ALIAS": 2 + } } } } From b4a038e6eaf12fd7f545df3fa531e6a36b04efdc 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:35 +0000 Subject: [PATCH 44/59] fix: do not import the whole google-gax from proto JS (#1553) (#81) 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-filestore/package.json | 2 +- packages/google-cloud-filestore/protos/protos.d.ts | 2 +- packages/google-cloud-filestore/protos/protos.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index fced8668fa1..b5db81ea7e6 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.0.1" + "google-gax": "^3.3.0" }, "devDependencies": { "@types/mocha": "^9.0.0", diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index 61c13249432..75c4327e3a7 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/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-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index 4d7c72ae3e9..cbafc3d8aca 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/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 3e2d09970fea3543604ecee3ee512180494b532c 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 20:48:25 +0000 Subject: [PATCH 45/59] fix: allow passing gax instance to client constructor (#82) - [ ] 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/cloud_filestore_manager_client.ts | 120 ++++++++++-------- .../v1beta1/cloud_filestore_manager_client.ts | 120 ++++++++++-------- 2 files changed, 140 insertions(+), 100 deletions(-) diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index a225be52adb..6faa738d985 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_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 './cloud_filestore_manager_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -117,8 +115,18 @@ export class CloudFilestoreManagerClient { * 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 CloudFilestoreManagerClient({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 CloudFilestoreManagerClient; @@ -139,8 +147,13 @@ export class CloudFilestoreManagerClient { 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); @@ -347,7 +360,7 @@ export class CloudFilestoreManagerClient { 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; } /** @@ -560,7 +573,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -644,7 +657,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -758,7 +771,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -784,11 +797,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -903,7 +917,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -929,11 +943,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -1051,7 +1066,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1077,11 +1092,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.restoreInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1189,7 +1205,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1215,11 +1231,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -1338,7 +1355,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1364,11 +1381,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.createBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1476,7 +1494,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1502,11 +1520,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.deleteBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1616,7 +1635,7 @@ export class CloudFilestoreManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'backup.name': request.backup!.name || '', }); this.initialize(); @@ -1642,11 +1661,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.updateBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1758,7 +1778,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1805,7 +1825,7 @@ export class CloudFilestoreManagerClient { 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']; @@ -1861,7 +1881,7 @@ export class CloudFilestoreManagerClient { 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']; @@ -1970,7 +1990,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -2018,7 +2038,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; @@ -2075,7 +2095,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index a76fcc0df21..bacfa48e269 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_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 './cloud_filestore_manager_client_config.json'; -import {operationsProtos} from 'google-gax'; const version = require('../../../package.json').version; /** @@ -120,8 +118,18 @@ export class CloudFilestoreManagerClient { * 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 CloudFilestoreManagerClient({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 CloudFilestoreManagerClient; @@ -142,8 +150,13 @@ export class CloudFilestoreManagerClient { 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); @@ -353,7 +366,7 @@ export class CloudFilestoreManagerClient { 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 CloudFilestoreManagerClient { 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(); @@ -665,7 +678,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -782,7 +795,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -808,11 +821,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -927,7 +941,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -953,11 +967,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -1078,7 +1093,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1104,11 +1119,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.restoreInstance, this._gaxModule.createDefaultBackoffSettings() @@ -1216,7 +1232,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1242,11 +1258,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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() @@ -1363,7 +1380,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1389,11 +1406,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.createBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1501,7 +1519,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1527,11 +1545,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.deleteBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1641,7 +1660,7 @@ export class CloudFilestoreManagerClient { options.otherArgs = options.otherArgs || {}; options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = - gax.routingHeader.fromParams({ + this._gaxModule.routingHeader.fromParams({ 'backup.name': request.backup!.name || '', }); this.initialize(); @@ -1667,11 +1686,12 @@ export class CloudFilestoreManagerClient { protos.google.cloud.common.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.updateBackup, this._gaxModule.createDefaultBackoffSettings() @@ -1783,7 +1803,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -1830,7 +1850,7 @@ export class CloudFilestoreManagerClient { 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']; @@ -1886,7 +1906,7 @@ export class CloudFilestoreManagerClient { 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']; @@ -2001,7 +2021,7 @@ export class CloudFilestoreManagerClient { 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(); @@ -2049,7 +2069,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; @@ -2106,7 +2126,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; From 140fa246509403b04c54696eef7f7da99fff4223 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:40:30 +0000 Subject: [PATCH 46/59] fix: preserve default values in x-goog-request-params header (#83) - [ ] 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/cloud_filestore_manager_client.ts | 30 +- .../v1beta1/cloud_filestore_manager_client.ts | 30 +- .../test/gapic_cloud_filestore_manager_v1.ts | 1257 +++++++++-------- .../gapic_cloud_filestore_manager_v1beta1.ts | 1257 +++++++++-------- 4 files changed, 1292 insertions(+), 1282 deletions(-) diff --git a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts index 6faa738d985..cd3231fca15 100644 --- a/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1/cloud_filestore_manager_client.ts @@ -574,7 +574,7 @@ export class CloudFilestoreManagerClient { 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); @@ -658,7 +658,7 @@ export class CloudFilestoreManagerClient { 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.getBackup(request, options, callback); @@ -772,7 +772,7 @@ export class CloudFilestoreManagerClient { 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); @@ -918,7 +918,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1067,7 +1067,7 @@ export class CloudFilestoreManagerClient { 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.restoreInstance(request, options, callback); @@ -1206,7 +1206,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1356,7 +1356,7 @@ export class CloudFilestoreManagerClient { 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.createBackup(request, options, callback); @@ -1495,7 +1495,7 @@ export class CloudFilestoreManagerClient { 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.deleteBackup(request, options, callback); @@ -1636,7 +1636,7 @@ export class CloudFilestoreManagerClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name || '', + 'backup.name': request.backup!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateBackup(request, options, callback); @@ -1779,7 +1779,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1826,7 +1826,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1882,7 +1882,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1991,7 +1991,7 @@ export class CloudFilestoreManagerClient { 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.listBackups(request, options, callback); @@ -2039,7 +2039,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; const callSettings = defaultCallSettings.merge(options); @@ -2096,7 +2096,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index bacfa48e269..4dd858d038c 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -587,7 +587,7 @@ export class CloudFilestoreManagerClient { 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); @@ -679,7 +679,7 @@ export class CloudFilestoreManagerClient { 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.getBackup(request, options, callback); @@ -796,7 +796,7 @@ export class CloudFilestoreManagerClient { 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); @@ -942,7 +942,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1094,7 +1094,7 @@ export class CloudFilestoreManagerClient { 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.restoreInstance(request, options, callback); @@ -1233,7 +1233,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1381,7 +1381,7 @@ export class CloudFilestoreManagerClient { 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.createBackup(request, options, callback); @@ -1520,7 +1520,7 @@ export class CloudFilestoreManagerClient { 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.deleteBackup(request, options, callback); @@ -1661,7 +1661,7 @@ export class CloudFilestoreManagerClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name || '', + 'backup.name': request.backup!.name ?? '', }); this.initialize(); return this.innerApiCalls.updateBackup(request, options, callback); @@ -1804,7 +1804,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1851,7 +1851,7 @@ export class CloudFilestoreManagerClient { 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); @@ -1907,7 +1907,7 @@ export class CloudFilestoreManagerClient { 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); @@ -2022,7 +2022,7 @@ export class CloudFilestoreManagerClient { 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.listBackups(request, options, callback); @@ -2070,7 +2070,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; const callSettings = defaultCallSettings.merge(options); @@ -2127,7 +2127,7 @@ export class CloudFilestoreManagerClient { 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['listBackups']; const callSettings = defaultCallSettings.merge(options); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 825d6e3b8f7..059f2ee6d66 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_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 @@ -263,26 +278,23 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.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 () => { @@ -295,15 +307,9 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1.Instance() ); @@ -326,11 +332,14 @@ describe('v1.CloudFilestoreManagerClient', () => { }); 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 () => { @@ -343,26 +352,23 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -375,7 +381,8 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -393,26 +400,23 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.filestore.v1.Backup() ); client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); const [response] = await client.getBackup(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup without error using callback', async () => { @@ -425,15 +429,9 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.filestore.v1.Backup() ); @@ -456,11 +454,14 @@ describe('v1.CloudFilestoreManagerClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup with error', async () => { @@ -473,23 +474,20 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBackup(request), expectedError); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup with closed client', async () => { @@ -502,7 +500,8 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBackup(request), expectedError); @@ -520,15 +519,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -537,11 +532,14 @@ describe('v1.CloudFilestoreManagerClient', () => { 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 () => { @@ -554,15 +552,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -592,11 +586,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -609,26 +606,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -641,15 +637,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -658,11 +650,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -720,16 +715,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -738,11 +730,14 @@ describe('v1.CloudFilestoreManagerClient', () => { 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 () => { @@ -755,16 +750,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -794,11 +786,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -811,27 +806,27 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -844,16 +839,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -862,11 +854,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -924,15 +919,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -941,11 +932,14 @@ describe('v1.CloudFilestoreManagerClient', () => { const [operation] = await client.restoreInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance without error using callback', async () => { @@ -958,15 +952,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -996,11 +986,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance with call error', async () => { @@ -1013,26 +1006,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.restoreInstance(request), expectedError); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance with LRO error', async () => { @@ -1045,15 +1037,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreInstance = stubLongRunningCall( undefined, @@ -1062,11 +1050,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.restoreInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRestoreInstanceProgress without error', async () => { @@ -1124,15 +1115,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -1141,11 +1128,14 @@ describe('v1.CloudFilestoreManagerClient', () => { 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 () => { @@ -1158,15 +1148,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -1196,11 +1182,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -1213,26 +1202,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -1245,15 +1233,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -1262,11 +1246,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -1324,15 +1311,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1340,11 +1323,14 @@ describe('v1.CloudFilestoreManagerClient', () => { const [operation] = await client.createBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup without error using callback', async () => { @@ -1357,15 +1343,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1395,11 +1377,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup with call error', async () => { @@ -1412,26 +1397,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createBackup(request), expectedError); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup with LRO error', async () => { @@ -1444,15 +1428,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -1461,11 +1441,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.createBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateBackupProgress without error', async () => { @@ -1520,15 +1503,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1536,11 +1515,14 @@ describe('v1.CloudFilestoreManagerClient', () => { const [operation] = await client.deleteBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup without error using callback', async () => { @@ -1553,15 +1535,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1591,11 +1569,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup with call error', async () => { @@ -1608,26 +1589,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteBackup(request), expectedError); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup with LRO error', async () => { @@ -1640,15 +1620,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -1657,11 +1633,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.deleteBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteBackupProgress without error', async () => { @@ -1716,16 +1695,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1733,11 +1709,14 @@ describe('v1.CloudFilestoreManagerClient', () => { const [operation] = await client.updateBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup without error using callback', async () => { @@ -1750,16 +1729,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1789,11 +1765,14 @@ describe('v1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup with call error', async () => { @@ -1806,27 +1785,27 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateBackup(request), expectedError); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup with LRO error', async () => { @@ -1839,16 +1818,13 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -1857,11 +1833,14 @@ describe('v1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.updateBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateBackupProgress without error', async () => { @@ -1916,15 +1895,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1.Instance()), generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), @@ -1933,11 +1908,14 @@ describe('v1.CloudFilestoreManagerClient', () => { 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 () => { @@ -1950,15 +1928,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1.Instance()), generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), @@ -1983,11 +1957,14 @@ describe('v1.CloudFilestoreManagerClient', () => { }); 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 () => { @@ -2000,26 +1977,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -2032,8 +2008,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1.Instance()), generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), @@ -2064,11 +2043,12 @@ describe('v1.CloudFilestoreManagerClient', () => { .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 + ) ); }); @@ -2082,8 +2062,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -2109,11 +2092,12 @@ describe('v1.CloudFilestoreManagerClient', () => { .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 + ) ); }); @@ -2127,8 +2111,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1.Instance()), generateSampleMessage(new protos.google.cloud.filestore.v1.Instance()), @@ -2148,11 +2135,12 @@ describe('v1.CloudFilestoreManagerClient', () => { ).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 + ) ); }); @@ -2166,8 +2154,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -2184,11 +2175,12 @@ describe('v1.CloudFilestoreManagerClient', () => { ).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 + ) ); }); }); @@ -2204,15 +2196,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), @@ -2221,11 +2209,14 @@ describe('v1.CloudFilestoreManagerClient', () => { client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); const [response] = await client.listBackups(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackups without error using callback', async () => { @@ -2238,15 +2229,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), @@ -2271,11 +2258,14 @@ describe('v1.CloudFilestoreManagerClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackups with error', async () => { @@ -2288,26 +2278,25 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listBackups = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listBackups(request), expectedError); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackupsStream without error', async () => { @@ -2320,8 +2309,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), @@ -2352,11 +2344,12 @@ describe('v1.CloudFilestoreManagerClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBackups, request) ); - assert.strictEqual( - (client.descriptors.page.listBackups.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2370,8 +2363,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.createStream = stubPageStreamingCall( undefined, @@ -2399,11 +2395,12 @@ describe('v1.CloudFilestoreManagerClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBackups, request) ); - assert.strictEqual( - (client.descriptors.page.listBackups.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2417,8 +2414,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), generateSampleMessage(new protos.google.cloud.filestore.v1.Backup()), @@ -2438,11 +2438,12 @@ describe('v1.CloudFilestoreManagerClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2456,8 +2457,11 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( undefined, @@ -2476,11 +2480,12 @@ describe('v1.CloudFilestoreManagerClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index b7eced66804..bb744394a95 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_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 @@ -265,26 +280,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.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 () => { @@ -297,15 +309,9 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1beta1.Instance() ); @@ -328,11 +334,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); 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 () => { @@ -345,26 +354,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -377,7 +383,8 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -395,26 +402,23 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() ); client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); const [response] = await client.getBackup(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup without error using callback', async () => { @@ -427,15 +431,9 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() ); @@ -458,11 +456,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup with error', async () => { @@ -475,23 +476,20 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); await assert.rejects(client.getBackup(request), expectedError); - assert( - (client.innerApiCalls.getBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes getBackup with closed client', async () => { @@ -504,7 +502,8 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - request.name = ''; + const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); await assert.rejects(client.getBackup(request), expectedError); @@ -522,15 +521,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -539,11 +534,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { 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 () => { @@ -556,15 +554,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -594,11 +588,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -611,26 +608,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -643,15 +639,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -660,11 +652,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -722,16 +717,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -740,11 +732,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { 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 () => { @@ -757,16 +752,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -796,11 +788,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -813,27 +808,27 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -846,16 +841,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -864,11 +856,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -926,15 +921,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -943,11 +934,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const [operation] = await client.restoreInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance without error using callback', async () => { @@ -960,15 +954,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -998,11 +988,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance with call error', async () => { @@ -1015,26 +1008,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreInstance = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.restoreInstance(request), expectedError); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes restoreInstance with LRO error', async () => { @@ -1047,15 +1039,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.restoreInstance = stubLongRunningCall( undefined, @@ -1064,11 +1052,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.restoreInstance(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.restoreInstance as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.restoreInstance as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkRestoreInstanceProgress without error', async () => { @@ -1126,15 +1117,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -1143,11 +1130,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { 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 () => { @@ -1160,15 +1150,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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() ); @@ -1198,11 +1184,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; 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 () => { @@ -1215,26 +1204,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -1247,15 +1235,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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, @@ -1264,11 +1248,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); 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 () => { @@ -1326,15 +1313,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1342,11 +1325,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const [operation] = await client.createBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup without error using callback', async () => { @@ -1359,15 +1345,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1397,11 +1379,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup with call error', async () => { @@ -1414,26 +1399,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.createBackup(request), expectedError); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes createBackup with LRO error', async () => { @@ -1446,15 +1430,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.createBackup = stubLongRunningCall( undefined, @@ -1463,11 +1443,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.createBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.createBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkCreateBackupProgress without error', async () => { @@ -1522,15 +1505,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1538,11 +1517,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const [operation] = await client.deleteBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup without error using callback', async () => { @@ -1555,15 +1537,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1593,11 +1571,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup with call error', async () => { @@ -1610,26 +1591,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.deleteBackup(request), expectedError); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes deleteBackup with LRO error', async () => { @@ -1642,15 +1622,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ + 'name', + ]); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.deleteBackup = stubLongRunningCall( undefined, @@ -1659,11 +1635,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.deleteBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkDeleteBackupProgress without error', async () => { @@ -1718,16 +1697,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1735,11 +1711,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const [operation] = await client.updateBackup(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup without error using callback', async () => { @@ -1752,16 +1731,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); @@ -1791,11 +1767,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup with call error', async () => { @@ -1808,27 +1787,27 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, expectedError ); await assert.rejects(client.updateBackup(request), expectedError); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes updateBackup with LRO error', async () => { @@ -1841,16 +1820,13 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); - request.backup = {}; - request.backup.name = ''; - const expectedHeaderRequestParams = 'backup.name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ + 'backup', + 'name', + ]); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.updateBackup = stubLongRunningCall( undefined, @@ -1859,11 +1835,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); const [operation] = await client.updateBackup(request); await assert.rejects(operation.promise(), expectedError); - assert( - (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes checkUpdateBackupProgress without error', async () => { @@ -1918,15 +1897,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1beta1.Instance() @@ -1941,11 +1916,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { 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 () => { @@ -1958,15 +1936,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1beta1.Instance() @@ -1997,11 +1971,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); 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 () => { @@ -2014,26 +1991,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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 () => { @@ -2046,8 +2022,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1beta1.Instance() @@ -2084,11 +2063,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .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 + ) ); }); @@ -2102,8 +2082,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -2129,11 +2112,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .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 + ) ); }); @@ -2147,8 +2131,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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.filestore.v1beta1.Instance() @@ -2174,11 +2161,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ).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 + ) ); }); @@ -2192,8 +2180,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.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); @@ -2210,11 +2201,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ).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 + ) ); }); }); @@ -2230,15 +2222,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() @@ -2253,11 +2241,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); const [response] = await client.listBackups(request); assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackups without error using callback', async () => { @@ -2270,15 +2261,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() @@ -2309,11 +2296,14 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions /*, callback defined above */) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackups with error', async () => { @@ -2326,26 +2316,25 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.innerApiCalls.listBackups = stubSimpleCall( undefined, expectedError ); await assert.rejects(client.listBackups(request), expectedError); - assert( - (client.innerApiCalls.listBackups as SinonStub) - .getCall(0) - .calledWith(request, expectedOptions, undefined) - ); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); it('invokes listBackupsStream without error', async () => { @@ -2358,8 +2347,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() @@ -2396,11 +2388,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBackups, request) ); - assert.strictEqual( - (client.descriptors.page.listBackups.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2414,8 +2407,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.createStream = stubPageStreamingCall( undefined, @@ -2443,11 +2439,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { .getCall(0) .calledWith(client.innerApiCalls.listBackups, request) ); - assert.strictEqual( - (client.descriptors.page.listBackups.createStream as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2461,8 +2458,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Backup() @@ -2488,11 +2488,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); @@ -2506,8 +2507,11 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - request.parent = ''; - const expectedHeaderRequestParams = 'parent='; + const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ + 'parent', + ]); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( undefined, @@ -2526,11 +2530,12 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ).args[1], request ); - assert.strictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[2].otherArgs.headers['x-goog-request-params'], - expectedHeaderRequestParams + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) ); }); }); From f4d16f955358fd3578f825ce2d8915014b3c8487 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:32:38 -0700 Subject: [PATCH 47/59] test: use fully qualified request type name in tests (#85) 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_cloud_filestore_manager_v1.ts | 342 ++++++++++-------- .../gapic_cloud_filestore_manager_v1beta1.ts | 342 ++++++++++-------- 2 files changed, 400 insertions(+), 284 deletions(-) diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts index 059f2ee6d66..8fbc5c44de8 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1.ts @@ -278,7 +278,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -307,7 +310,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -352,7 +358,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -381,7 +390,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -400,7 +412,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -429,7 +444,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -474,7 +492,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -500,7 +521,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -519,9 +543,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -552,9 +577,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -606,9 +632,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -637,9 +664,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -716,10 +744,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -751,10 +779,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -807,10 +835,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -840,10 +868,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -919,9 +947,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -952,9 +981,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1006,9 +1036,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1037,9 +1068,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1115,9 +1147,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1148,9 +1181,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1202,9 +1236,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1233,9 +1268,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1311,9 +1347,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1343,9 +1380,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1397,9 +1435,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1428,9 +1467,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1503,9 +1543,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1535,9 +1576,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1589,9 +1631,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1620,9 +1663,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1696,10 +1740,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1730,10 +1774,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1786,10 +1830,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1819,10 +1863,10 @@ describe('v1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1895,9 +1939,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1928,9 +1973,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1977,9 +2023,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2008,9 +2055,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2062,9 +2110,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2111,9 +2160,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2154,9 +2204,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2196,9 +2247,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2229,9 +2281,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2278,9 +2331,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2309,9 +2363,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2363,9 +2418,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2414,9 +2470,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2457,9 +2514,10 @@ describe('v1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index bb744394a95..322ee26627e 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -280,7 +280,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -309,7 +312,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -354,7 +360,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -383,7 +392,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('GetInstanceRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -402,7 +414,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -431,7 +446,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -476,7 +494,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -502,7 +523,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.GetBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('GetBackupRequest', ['name']); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedError = new Error('The client has already been closed.'); client.close(); @@ -521,9 +545,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -554,9 +579,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -608,9 +634,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -639,9 +666,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateInstanceRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateInstanceRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -718,10 +746,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -753,10 +781,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -809,10 +837,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -842,10 +870,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateInstanceRequest() ); request.instance ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateInstanceRequest', [ - 'instance', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateInstanceRequest', + ['instance', 'name'] + ); request.instance.name = defaultValue1; const expectedHeaderRequestParams = `instance.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -921,9 +949,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -954,9 +983,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1008,9 +1038,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1039,9 +1070,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.RestoreInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('RestoreInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.RestoreInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1117,9 +1149,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1150,9 +1183,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1204,9 +1238,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1235,9 +1270,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteInstanceRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1313,9 +1349,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1345,9 +1382,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1399,9 +1437,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1430,9 +1469,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('CreateBackupRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1505,9 +1545,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1537,9 +1578,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1591,9 +1633,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1622,9 +1665,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() ); - const defaultValue1 = getTypeDefaultValue('DeleteBackupRequest', [ - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1698,10 +1742,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1732,10 +1776,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedResponse = generateSampleMessage( @@ -1788,10 +1832,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1821,10 +1865,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() ); request.backup ??= {}; - const defaultValue1 = getTypeDefaultValue('UpdateBackupRequest', [ - 'backup', - 'name', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); request.backup.name = defaultValue1; const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; const expectedError = new Error('expected'); @@ -1897,9 +1941,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1936,9 +1981,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -1991,9 +2037,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2022,9 +2069,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2082,9 +2130,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2131,9 +2180,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2180,9 +2230,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() ); - const defaultValue1 = getTypeDefaultValue('ListInstancesRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2222,9 +2273,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2261,9 +2313,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2316,9 +2369,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2347,9 +2401,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2407,9 +2462,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); @@ -2458,9 +2514,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ @@ -2507,9 +2564,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const request = generateSampleMessage( new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() ); - const defaultValue1 = getTypeDefaultValue('ListBackupsRequest', [ - 'parent', - ]); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); From 6b2e63aca6e04e4bc091bc7a5147440204c99f20 Mon Sep 17 00:00:00 2001 From: Alexander Fenster Date: Thu, 3 Nov 2022 23:39:46 -0700 Subject: [PATCH 48/59] fix(deps): use google-gax v3.5.2 (#89) --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index b5db81ea7e6..98f86f06ece 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -39,7 +39,7 @@ "test": "c8 mocha build/test" }, "dependencies": { - "google-gax": "^3.3.0" + "google-gax": "^3.5.2" }, "devDependencies": { "@types/mocha": "^9.0.0", From f62c9ca767798cc8ffe7cc9967aadff612f5ef2b Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 10:36:19 +0100 Subject: [PATCH 49/59] chore(deps): update dependency jsdoc to v4 (#91) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 98f86f06ece..30b33301d7e 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 b0c068577db129f47f506819105cb67c6b8b7e08 Mon Sep 17 00:00:00 2001 From: Mend Renovate Date: Thu, 10 Nov 2022 11:14:32 +0100 Subject: [PATCH 50/59] chore(deps): update dependency @types/node to v18 (#87) 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-filestore). --- packages/google-cloud-filestore/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 30b33301d7e..a21aaa3056b 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/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 97087c6fb7122c8996ad0cb72b438302bd7063a6 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 11:06:20 +0000 Subject: [PATCH 51/59] fix: regenerated protos JS and TS definitions (#92) 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 --- .../google-cloud-filestore/protos/protos.d.ts | 2 +- .../google-cloud-filestore/protos/protos.js | 192 +++++++++++++++--- 2 files changed, 168 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index 75c4327e3a7..c03487cf1dc 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/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-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index cbafc3d8aca..2e5c6bff608 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/protos/protos.js @@ -1069,6 +1069,10 @@ for (var i = 0; i < object.modes.length; ++i) switch (object.modes[i]) { default: + if (typeof object.modes[i] === "number") { + message.modes[i] = object.modes[i]; + break; + } case "ADDRESS_MODE_UNSPECIFIED": case 0: message.modes[i] = 0; @@ -1117,7 +1121,7 @@ if (message.modes && message.modes.length) { object.modes = []; for (var j = 0; j < message.modes.length; ++j) - object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; + object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1.NetworkConfig.AddressMode[message.modes[j]] === undefined ? message.modes[j] : $root.google.cloud.filestore.v1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; } if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) object.reservedIpRange = message.reservedIpRange; @@ -1749,6 +1753,12 @@ message.ipRanges[i] = String(object.ipRanges[i]); } switch (object.accessMode) { + default: + if (typeof object.accessMode === "number") { + message.accessMode = object.accessMode; + break; + } + break; case "ACCESS_MODE_UNSPECIFIED": case 0: message.accessMode = 0; @@ -1763,6 +1773,12 @@ break; } switch (object.squashMode) { + default: + if (typeof object.squashMode === "number") { + message.squashMode = object.squashMode; + break; + } + break; case "SQUASH_MODE_UNSPECIFIED": case 0: message.squashMode = 0; @@ -1832,9 +1848,9 @@ object.ipRanges[j] = message.ipRanges[j]; } if (message.accessMode != null && message.hasOwnProperty("accessMode")) - object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; + object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.AccessMode[message.accessMode] === undefined ? message.accessMode : $root.google.cloud.filestore.v1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; if (message.squashMode != null && message.hasOwnProperty("squashMode")) - object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; + object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1.NfsExportOptions.SquashMode[message.squashMode] === undefined ? message.squashMode : $root.google.cloud.filestore.v1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; if (message.anonUid != null && message.hasOwnProperty("anonUid")) if (typeof message.anonUid === "number") object.anonUid = options.longs === String ? String(message.anonUid) : message.anonUid; @@ -2312,6 +2328,12 @@ if (object.description != null) message.description = String(object.description); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -2349,6 +2371,12 @@ message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; case "TIER_UNSPECIFIED": case 0: message.tier = 0; @@ -2445,13 +2473,13 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1.Instance.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1.Instance.State[message.state] : message.state; if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) object.statusMessage = message.statusMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.tier] : message.tier; + object.tier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.filestore.v1.Instance.Tier[message.tier] : message.tier; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -4700,6 +4728,12 @@ if (object.description != null) message.description = String(object.description); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -4756,6 +4790,12 @@ if (object.sourceFileShare != null) message.sourceFileShare = String(object.sourceFileShare); switch (object.sourceInstanceTier) { + default: + if (typeof object.sourceInstanceTier === "number") { + message.sourceInstanceTier = object.sourceInstanceTier; + break; + } + break; case "TIER_UNSPECIFIED": case 0: message.sourceInstanceTier = 0; @@ -4843,7 +4883,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1.Backup.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1.Backup.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); var keys2; @@ -4867,7 +4907,7 @@ if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) object.sourceFileShare = message.sourceFileShare; if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) - object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; + object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1.Instance.Tier[message.sourceInstanceTier] === undefined ? message.sourceInstanceTier : $root.google.cloud.filestore.v1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) if (typeof message.downloadBytes === "number") object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; @@ -7060,6 +7100,10 @@ for (var i = 0; i < object.modes.length; ++i) switch (object.modes[i]) { default: + if (typeof object.modes[i] === "number") { + message.modes[i] = object.modes[i]; + break; + } case "ADDRESS_MODE_UNSPECIFIED": case 0: message.modes[i] = 0; @@ -7108,7 +7152,7 @@ if (message.modes && message.modes.length) { object.modes = []; for (var j = 0; j < message.modes.length; ++j) - object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; + object.modes[j] = options.enums === String ? $root.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[message.modes[j]] === undefined ? message.modes[j] : $root.google.cloud.filestore.v1beta1.NetworkConfig.AddressMode[message.modes[j]] : message.modes[j]; } if (message.reservedIpRange != null && message.hasOwnProperty("reservedIpRange")) object.reservedIpRange = message.reservedIpRange; @@ -7740,6 +7784,12 @@ message.ipRanges[i] = String(object.ipRanges[i]); } switch (object.accessMode) { + default: + if (typeof object.accessMode === "number") { + message.accessMode = object.accessMode; + break; + } + break; case "ACCESS_MODE_UNSPECIFIED": case 0: message.accessMode = 0; @@ -7754,6 +7804,12 @@ break; } switch (object.squashMode) { + default: + if (typeof object.squashMode === "number") { + message.squashMode = object.squashMode; + break; + } + break; case "SQUASH_MODE_UNSPECIFIED": case 0: message.squashMode = 0; @@ -7823,9 +7879,9 @@ object.ipRanges[j] = message.ipRanges[j]; } if (message.accessMode != null && message.hasOwnProperty("accessMode")) - object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; + object.accessMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode[message.accessMode] === undefined ? message.accessMode : $root.google.cloud.filestore.v1beta1.NfsExportOptions.AccessMode[message.accessMode] : message.accessMode; if (message.squashMode != null && message.hasOwnProperty("squashMode")) - object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; + object.squashMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode[message.squashMode] === undefined ? message.squashMode : $root.google.cloud.filestore.v1beta1.NfsExportOptions.SquashMode[message.squashMode] : message.squashMode; if (message.anonUid != null && message.hasOwnProperty("anonUid")) if (typeof message.anonUid === "number") object.anonUid = options.longs === String ? String(message.anonUid) : message.anonUid; @@ -8303,6 +8359,12 @@ if (object.description != null) message.description = String(object.description); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -8340,6 +8402,12 @@ message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } switch (object.tier) { + default: + if (typeof object.tier === "number") { + message.tier = object.tier; + break; + } + break; case "TIER_UNSPECIFIED": case 0: message.tier = 0; @@ -8436,13 +8504,13 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Instance.State[message.state] : message.state; if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) object.statusMessage = message.statusMessage; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.tier] : message.tier; + object.tier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.tier] === undefined ? message.tier : $root.google.cloud.filestore.v1beta1.Instance.Tier[message.tier] : message.tier; var keys2; if (message.labels && (keys2 = Object.keys(message.labels)).length) { object.labels = {}; @@ -10600,6 +10668,12 @@ if (object.description != null) message.description = String(object.description); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -10672,7 +10746,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Snapshot.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Snapshot.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Snapshot.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); var keys2; @@ -11135,6 +11209,12 @@ if (object.description != null) message.description = String(object.description); switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; case "STATE_UNSPECIFIED": case 0: message.state = 0; @@ -11191,6 +11271,12 @@ if (object.sourceFileShare != null) message.sourceFileShare = String(object.sourceFileShare); switch (object.sourceInstanceTier) { + default: + if (typeof object.sourceInstanceTier === "number") { + message.sourceInstanceTier = object.sourceInstanceTier; + break; + } + break; case "TIER_UNSPECIFIED": case 0: message.sourceInstanceTier = 0; @@ -11278,7 +11364,7 @@ if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Backup.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Backup.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); var keys2; @@ -11302,7 +11388,7 @@ if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) object.sourceFileShare = message.sourceFileShare; if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) - object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; + object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] === undefined ? message.sourceInstanceTier : $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) if (typeof message.downloadBytes === "number") object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; @@ -14155,6 +14241,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; @@ -14179,6 +14271,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; @@ -14226,7 +14322,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")) @@ -14234,7 +14330,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; }; @@ -17045,6 +17141,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; @@ -17059,6 +17161,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; @@ -17185,9 +17293,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")) @@ -19534,6 +19642,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; @@ -19642,7 +19756,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")) @@ -20444,6 +20558,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; @@ -20460,6 +20580,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; @@ -20498,6 +20624,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; @@ -20568,7 +20698,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")) @@ -20576,7 +20706,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")) @@ -20589,7 +20719,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); @@ -21966,6 +22096,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; @@ -22035,7 +22171,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) @@ -23790,6 +23926,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; @@ -23839,7 +23981,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; }; From 832c7651aac9bc766d35f33f47be17e468c669fb 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 18:35:06 -0800 Subject: [PATCH 52/59] feat: new APIs added to reflect updates to the filestore service (#93) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: new APIs added to reflect updates to the filestore service - Add ENTERPRISE Tier - Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot - Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare - Add ConnectMode to NetworkConfig (for Private Service Access support) - New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING) - Add SuspensionReason (for KMS related suspension) - Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled PiperOrigin-RevId: 487492758 Source-Link: https://github.com/googleapis/googleapis/commit/5be5981f50322cf0c7388595e0f31ac5d0693469 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab0e217f560cc2c1afc11441c2eab6b6950efd2b Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9 * 🦉 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 --- .../v1beta1/cloud_filestore_service.proto | 528 +- .../google-cloud-filestore/protos/protos.d.ts | 2476 ++++++- .../google-cloud-filestore/protos/protos.js | 6457 ++++++++++++++--- .../google-cloud-filestore/protos/protos.json | 641 +- .../cloud_filestore_manager.create_backup.js | 2 +- ...cloud_filestore_manager.create_instance.js | 2 +- .../cloud_filestore_manager.create_share.js | 76 + ...cloud_filestore_manager.create_snapshot.js | 76 + ...cloud_filestore_manager.delete_instance.js | 5 + .../cloud_filestore_manager.delete_share.js | 63 + ...cloud_filestore_manager.delete_snapshot.js | 63 + .../cloud_filestore_manager.get_share.js | 62 + .../cloud_filestore_manager.get_snapshot.js | 62 + .../cloud_filestore_manager.list_backups.js | 2 +- .../cloud_filestore_manager.list_shares.js | 82 + .../cloud_filestore_manager.list_snapshots.js | 82 + ...loud_filestore_manager.restore_instance.js | 2 +- ...cloud_filestore_manager.revert_instance.js | 70 + .../cloud_filestore_manager.update_share.js | 74 + ...cloud_filestore_manager.update_snapshot.js | 68 + ...tadata.google.cloud.filestore.v1beta1.json | 506 +- .../v1beta1/cloud_filestore_manager_client.ts | 2573 ++++++- ...cloud_filestore_manager_client_config.json | 48 + .../src/v1beta1/gapic_metadata.json | 118 + .../gapic_cloud_filestore_manager_v1beta1.ts | 3952 ++++++++-- 25 files changed, 15940 insertions(+), 2150 deletions(-) create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js create mode 100644 packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js diff --git a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto index eff84710592..bf600312e2d 100644 --- a/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto +++ b/packages/google-cloud-filestore/protos/google/cloud/filestore/v1beta1/cloud_filestore_service.proto @@ -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. @@ -20,6 +20,7 @@ import "google/api/annotations.proto"; import "google/api/client.proto"; import "google/api/field_behavior.proto"; import "google/api/resource.proto"; +import "google/cloud/common/operation_metadata.proto"; import "google/longrunning/operations.proto"; import "google/protobuf/field_mask.proto"; import "google/protobuf/timestamp.proto"; @@ -32,17 +33,17 @@ option java_outer_classname = "CloudFilestoreServiceProto"; option java_package = "com.google.cloud.filestore.v1beta1"; option php_namespace = "Google\\Cloud\\Filestore\\V1beta1"; -// Configures and manages Cloud Filestore resources. +// Configures and manages Filestore resources. // -// Cloud Filestore Manager v1beta1. +// Filestore Manager v1beta1. // -// The `file.googleapis.com` service implements the Cloud Filestore API and +// The `file.googleapis.com` service implements the Filestore API and // defines the following model for managing resources: // * The service works with a collection of cloud projects, named: `/projects/*` // * Each project has a collection of available locations, named: `/locations/*` // * Each location has a collection of instances and backups, named: // `/instances/*` and `/backups/*` respectively. -// * As such, Cloud Filestore instances are resources of the form: +// * As such, Filestore instances are resources of the form: // `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` // backups are resources of the form: // `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` @@ -120,6 +121,18 @@ service CloudFilestoreManager { }; } + // Revert an existing instance's file system to a specified snapshot. + rpc RevertInstance(RevertInstanceRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{name=projects/*/locations/*/instances/*}:revert" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "Instance" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + // Deletes an instance. rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { option (google.api.http) = { @@ -132,6 +145,61 @@ service CloudFilestoreManager { }; } + // Lists all snapshots in a project for either a specified location + // or for all locations. + rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific snapshot. + rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a snapshot. + rpc CreateSnapshot(CreateSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots" + body: "snapshot" + }; + option (google.api.method_signature) = "parent,snapshot,snapshot_id"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a snapshot. + rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific snapshot. + rpc UpdateSnapshot(UpdateSnapshotRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}" + body: "snapshot" + }; + option (google.api.method_signature) = "snapshot,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Snapshot" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + // Lists all backups in a project for either a specified location or for all // locations. rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { @@ -186,11 +254,65 @@ service CloudFilestoreManager { metadata_type: "google.cloud.common.OperationMetadata" }; } + + // Lists all shares for a specified instance. + rpc ListShares(ListSharesRequest) returns (ListSharesResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets the details of a specific share. + rpc GetShare(GetShareRequest) returns (Share) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a share. + rpc CreateShare(CreateShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares" + body: "share" + }; + option (google.api.method_signature) = "parent,share,share_id"; + option (google.longrunning.operation_info) = { + response_type: "Share" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Deletes a share. + rpc DeleteShare(DeleteShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } + + // Updates the settings of a specific share. + rpc UpdateShare(UpdateShareRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}" + body: "share" + }; + option (google.api.method_signature) = "share,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Share" + metadata_type: "google.cloud.common.OperationMetadata" + }; + } } // Network configuration for the instance. message NetworkConfig { - // Internet protocol versions supported by Cloud Filestore. + // Internet protocol versions supported by Filestore. enum AddressMode { // Internet protocol not set. ADDRESS_MODE_UNSPECIFIED = 0; @@ -199,6 +321,20 @@ message NetworkConfig { MODE_IPV4 = 1; } + // Available connection modes. + enum ConnectMode { + // ConnectMode not set. + CONNECT_MODE_UNSPECIFIED = 0; + + // Connect via direct peering to the Filestore service. + DIRECT_PEERING = 1; + + // Connect to your Filestore instance using Private Service + // Access. Private services access provides an IP address range for multiple + // Google Cloud services, including Filestore. + PRIVATE_SERVICE_ACCESS = 2; + } + // The name of the Google Compute Engine // [VPC network](https://cloud.google.com/vpc/docs/vpc) to which the // instance is connected. @@ -208,28 +344,46 @@ message NetworkConfig { // assigned. For this version, only MODE_IPV4 is supported. repeated AddressMode modes = 3; - // A /29 CIDR block for Basic or a /23 CIDR block for High Scale in one of the - // [internal IP address + // Optional, reserved_ip_range can have one of the following two types of + // values. + // + // * CIDR range value when using DIRECT_PEERING connect mode. + // * [Allocated IP address + // range](https://cloud.google.com/compute/docs/ip-addresses/reserve-static-internal-ip-address) + // when using PRIVATE_SERVICE_ACCESS connect mode. + // + // When the name of an allocated IP address range is specified, it must be one + // of the ranges associated with the private service access connection. + // When specified as a direct CIDR value, it must be a /29 CIDR block for + // Basic tier, a /24 CIDR block for High Scale tier, or a /26 CIDR block for + // Enterprise tier in one of the [internal IP address // ranges](https://www.arin.net/reference/research/statistics/address_filters/) // that identifies the range of IP addresses reserved for this instance. For - // example, 10.0.0.0/29 or 192.168.0.0/23. The range you specify can't overlap - // with either existing subnets or assigned IP address ranges for other Cloud - // Filestore instances in the selected VPC network. + // example, 10.0.0.0/29, 192.168.0.0/24, or 192.168.0.0/26, respectively. The + // range you specify can't overlap with either existing subnets or assigned IP + // address ranges for other Filestore instances in the selected VPC + // network. string reserved_ip_range = 4; - // Output only. IPv4 addresses in the format - // `{octet1}.{octet2}.{octet3}.{octet4}` or IPv6 addresses in the format + // Output only. IPv4 addresses in the format `{octet1}.{octet2}.{octet3}.{octet4}` or + // IPv6 addresses in the format // `{block1}:{block2}:{block3}:{block4}:{block5}:{block6}:{block7}:{block8}`. repeated string ip_addresses = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The network connect mode of the Filestore instance. + // If not provided, the connect mode defaults to DIRECT_PEERING. + ConnectMode connect_mode = 6; } // File share configuration for the instance. message FileShareConfig { - // The name of the file share (must be 16 characters or less). + // The name of the file share (must be 32 characters or less for + // Enterprise and High Scale SSD tiers and 16 characters or less for all other + // tiers). string name = 1; // File share capacity in gigabytes (GB). - // Cloud Filestore defines 1 GB as 1024^3 bytes. + // Filestore defines 1 GB as 1024^3 bytes. int64 capacity_gb = 2; // The source that this file share has been restored from. Empty if the file @@ -307,7 +461,7 @@ message NfsExportOptions { int64 anon_gid = 5; } -// A Cloud Filestore instance. +// A Filestore instance. message Instance { option (google.api.resource) = { type: "file.googleapis.com/Instance" @@ -340,6 +494,19 @@ message Instance { // The instance is restoring a snapshot or backup to an existing file share // and may be unusable during this time. RESTORING = 7; + + // The instance is suspended. You can get further details from + // the `suspension_reasons` field of the `Instance` resource. + SUSPENDED = 8; + + // The instance is reverting to a snapshot. + REVERTING = 9; + + // The instance is in the process of becoming suspended. + SUSPENDING = 10; + + // The instance is in the process of becoming active. + RESUMING = 11; } // Available service tiers. @@ -366,6 +533,19 @@ message Instance { // HIGH_SCALE instances offer expanded capacity and performance scaling // capabilities. HIGH_SCALE_SSD = 6; + + // ENTERPRISE instances offer the features and availability needed for + // mission-critical workloads. + ENTERPRISE = 7; + } + + // SuspensionReason contains the possible reasons for a suspension. + enum SuspensionReason { + // Not set. + SUSPENSION_REASON_UNSPECIFIED = 0; + + // The KMS key used by the instance is either revoked or denied access to. + KMS_KEY_ISSUE = 1; } // Output only. The resource name of the instance, in the format @@ -404,12 +584,37 @@ message Instance { // Output only. Reserved for future use. google.protobuf.BoolValue satisfies_pzs = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // KMS key name used for data encryption. + string kms_key_name = 14; + + // Output only. Field indicates all the reasons the instance is in "SUSPENDED" state. + repeated SuspensionReason suspension_reasons = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The max capacity of the instance. + int64 max_capacity_gb = 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The increase/decrease capacity step size. + int64 capacity_step_size_gb = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The max number of shares allowed. + int64 max_share_count = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The storage capacity of the instance in gigabytes (GB = 1024^3 bytes). + // This capacity can be increased up to `max_capacity_gb` GB in multipliers + // of `capacity_step_size_gb` GB. + int64 capacity_gb = 19; + + // Indicates whether this instance uses a multi-share configuration with which + // it can have more than one file-share or none at all. File-shares are added, + // updated and removed through the separate file-share APIs. + bool multi_share_enabled = 20; } // CreateInstanceRequest creates an instance. message CreateInstanceRequest { // Required. The instance's project and location, in the format - // `projects/{project_id}/locations/{location}`. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Filestore, // locations map to GCP zones, for example **us-west1-b**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -456,7 +661,7 @@ message UpdateInstanceRequest { Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; } -// RestoreInstanceRequest restores an existing instances's file share from a +// RestoreInstanceRequest restores an existing instance's file share from a // snapshot or backup. message RestoreInstanceRequest { // Required. The resource name of the instance, in the format @@ -468,7 +673,7 @@ message RestoreInstanceRequest { } ]; - // Required. Name of the file share in the Cloud Filestore instance that the snapshot + // Required. Name of the file share in the Filestore instance that the snapshot // is being restored to. string file_share = 2 [(google.api.field_behavior) = REQUIRED]; @@ -487,6 +692,24 @@ message RestoreInstanceRequest { } } +// RevertInstanceRequest reverts the given instance's file share to the +// specified snapshot. +message RevertInstanceRequest { + // Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}. + // The resource name of the instance, in the format + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The snapshot resource ID, in the format 'my-snapshot', where the specified + // ID is the {snapshot_id} of the fully qualified name like + // projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id} + string target_snapshot_id = 2 [(google.api.field_behavior) = REQUIRED]; +} + // DeleteInstanceRequest deletes an instance. message DeleteInstanceRequest { // Required. The instance resource name, in the format @@ -497,6 +720,10 @@ message DeleteInstanceRequest { type: "file.googleapis.com/Instance" } ]; + + // If set to true, any snapshots of the instance will also be deleted. + // (Otherwise, the request will only work if the instance has no snapshots.) + bool force = 2; } // ListInstancesRequest lists instances. @@ -545,7 +772,7 @@ message ListInstancesResponse { repeated string unreachable = 3; } -// A Cloud Filestore snapshot. +// A Filestore snapshot. message Snapshot { option (google.api.resource) = { type: "file.googleapis.com/Snapshot" @@ -588,7 +815,99 @@ message Snapshot { int64 filesystem_used_bytes = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; } -// A Cloud Filestore backup. +// CreateSnapshotRequest creates a snapshot. +message CreateSnapshotRequest { + // Required. The Filestore Instance to create the snapshots of, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the snapshot. + // The ID must be unique within the specified instance. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string snapshot_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A snapshot resource + Snapshot snapshot = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetSnapshotRequest gets the state of a snapshot. +message GetSnapshotRequest { + // Required. The snapshot resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + } + ]; +} + +// DeleteSnapshotRequest deletes a snapshot. +message DeleteSnapshotRequest { + // Required. The snapshot resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Snapshot" + } + ]; +} + +// UpdateSnapshotRequest updates description and/or labels for a snapshot. +message UpdateSnapshotRequest { + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. A snapshot resource + Snapshot snapshot = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// ListSnapshotsRequest lists snapshots. +message ListSnapshotsRequest { + // Required. The instance for which to retrieve snapshot information, + // in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.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; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListSnapshotsResponse is the result of ListSnapshotsRequest. +message ListSnapshotsResponse { + // A list of snapshots in the project for the specified instance. + repeated Snapshot snapshots = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; +} + +// A Filestore backup. message Backup { option (google.api.resource) = { type: "file.googleapis.com/Backup" @@ -638,18 +957,18 @@ message Backup { // this number is expected to change with backup creation/deletion. int64 storage_bytes = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - // The resource name of the source Cloud Filestore instance, in the format + // The resource name of the source Filestore instance, in the format // `projects/{project_id}/locations/{location_id}/instances/{instance_id}`, // used to create this backup. string source_instance = 8 [(google.api.resource_reference) = { type: "file.googleapis.com/Instance" }]; - // Name of the file share in the source Cloud Filestore instance that the + // Name of the file share in the source Filestore instance that the // backup is created from. string source_file_share = 9; - // Output only. The service tier of the source Cloud Filestore instance that this backup + // Output only. The service tier of the source Filestore instance that this backup // is created from. Instance.Tier source_instance_tier = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; @@ -658,12 +977,15 @@ message Backup { // Output only. Reserved for future use. google.protobuf.BoolValue satisfies_pzs = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Immutable. KMS key name used for data encryption. + string kms_key_name = 13 [(google.api.field_behavior) = IMMUTABLE]; } // CreateBackupRequest creates a backup. message CreateBackupRequest { // Required. The backup's project and location, in the format - // `projects/{project_id}/locations/{location}`. In Cloud Filestore, + // `projects/{project_id}/locations/{location}`. In Filestore, // backup locations map to GCP regions, for example **us-west1**. string parent = 1 [ (google.api.field_behavior) = REQUIRED, @@ -721,7 +1043,7 @@ message GetBackupRequest { message ListBackupsRequest { // Required. The project and location for which to retrieve backup information, // in the format `projects/{project_id}/locations/{location}`. - // In Cloud Filestore, backup locations map to GCP regions, + // In Filestore, backup locations map to GCP regions, // for example **us-west1**. // To retrieve backup information for all locations, use "-" for the // `{location}` value. @@ -764,3 +1086,157 @@ message ListBackupsResponse { // Locations that could not be reached. repeated string unreachable = 3; } + +// A Filestore share. +message Share { + option (google.api.resource) = { + type: "file.googleapis.com/Share" + pattern: "projects/{project}/locations/{location}/instances/{instance}/shares/{share}" + }; + + // The share state. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // Share is being created. + CREATING = 1; + + // Share is ready for use. + READY = 3; + + // Share is being deleted. + DELETING = 4; + } + + // Output only. The resource name of the share, in the format + // `projects/{project_id}/locations/{location_id}/instances/{instance_id}/shares/{share_id}`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The mount name of the share. Must be 63 characters or less and consist of + // uppercase or lowercase letters, numbers, and underscores. + string mount_name = 2; + + // A description of the share with 2048 characters or less. Requests with + // longer descriptions will be rejected. + string description = 3; + + // File share capacity in gigabytes (GB). Filestore defines 1 GB as + // 1024^3 bytes. Must be greater than 0. + int64 capacity_gb = 4; + + // Nfs Export Options. + // There is a limit of 10 export options per file share. + repeated NfsExportOptions nfs_export_options = 5; + + // Output only. The share state. + State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the share was created. + google.protobuf.Timestamp create_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Resource labels to represent user provided metadata. + map labels = 8; +} + +// CreateShareRequest creates a share. +message CreateShareRequest { + // Required. The Filestore Instance to create the share for, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Instance" + } + ]; + + // Required. The ID to use for the share. + // The ID must be unique within the specified instance. + // + // This value must start with a lowercase letter followed by up to 62 + // lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + string share_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A share resource + Share share = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// GetShareRequest gets the state of a share. +message GetShareRequest { + // Required. The share resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Share" + } + ]; +} + +// DeleteShareRequest deletes a share. +message DeleteShareRequest { + // Required. The share resource name, in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.googleapis.com/Share" + } + ]; +} + +// ListSharesRequest lists shares. +message ListSharesRequest { + // Required. The instance for which to retrieve share information, + // in the format + // `projects/{project_id}/locations/{location}/instances/{instance_id}`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "file.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; + + // Sort results. Supported values are "name", "name desc" or "" (unsorted). + string order_by = 4; + + // List filter. + string filter = 5; +} + +// ListSharesResponse is the result of ListSharesRequest. +message ListSharesResponse { + // A list of shares in the project for the specified instance. + repeated Share shares = 1; + + // The token you can use to retrieve the next page of results. Not returned + // if there are no more results in the list. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// UpdateShareRequest updates the settings of a share. +message UpdateShareRequest { + // Required. A share resource. + // Only fields specified in update_mask are updated. + Share share = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Mask of fields to update. At least one path must be supplied in this + // field. + // The elements of the repeated paths field may only include these fields: + // + // * "description" + // * "capacity_gb" + // * "labels" + // * "nfs_export_options" + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} diff --git a/packages/google-cloud-filestore/protos/protos.d.ts b/packages/google-cloud-filestore/protos/protos.d.ts index c03487cf1dc..a58e3cf43e4 100644 --- a/packages/google-cloud-filestore/protos/protos.d.ts +++ b/packages/google-cloud-filestore/protos/protos.d.ts @@ -2632,6 +2632,20 @@ export namespace google { */ public restoreInstance(request: google.cloud.filestore.v1beta1.IRestoreInstanceRequest): Promise; + /** + * Calls RevertInstance. + * @param request RevertInstanceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public revertInstance(request: google.cloud.filestore.v1beta1.IRevertInstanceRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.RevertInstanceCallback): void; + + /** + * Calls RevertInstance. + * @param request RevertInstanceRequest message or plain object + * @returns Promise + */ + public revertInstance(request: google.cloud.filestore.v1beta1.IRevertInstanceRequest): Promise; + /** * Calls DeleteInstance. * @param request DeleteInstanceRequest message or plain object @@ -2646,6 +2660,76 @@ export namespace google { */ public deleteInstance(request: google.cloud.filestore.v1beta1.IDeleteInstanceRequest): Promise; + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSnapshotsResponse + */ + public listSnapshots(request: google.cloud.filestore.v1beta1.IListSnapshotsRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSnapshotsCallback): void; + + /** + * Calls ListSnapshots. + * @param request ListSnapshotsRequest message or plain object + * @returns Promise + */ + public listSnapshots(request: google.cloud.filestore.v1beta1.IListSnapshotsRequest): Promise; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Snapshot + */ + public getSnapshot(request: google.cloud.filestore.v1beta1.IGetSnapshotRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.GetSnapshotCallback): void; + + /** + * Calls GetSnapshot. + * @param request GetSnapshotRequest message or plain object + * @returns Promise + */ + public getSnapshot(request: google.cloud.filestore.v1beta1.IGetSnapshotRequest): Promise; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createSnapshot(request: google.cloud.filestore.v1beta1.ICreateSnapshotRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateSnapshotCallback): void; + + /** + * Calls CreateSnapshot. + * @param request CreateSnapshotRequest message or plain object + * @returns Promise + */ + public createSnapshot(request: google.cloud.filestore.v1beta1.ICreateSnapshotRequest): Promise; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteSnapshot(request: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteSnapshotCallback): void; + + /** + * Calls DeleteSnapshot. + * @param request DeleteSnapshotRequest message or plain object + * @returns Promise + */ + public deleteSnapshot(request: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest): Promise; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateSnapshot(request: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateSnapshotCallback): void; + + /** + * Calls UpdateSnapshot. + * @param request UpdateSnapshotRequest message or plain object + * @returns Promise + */ + public updateSnapshot(request: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest): Promise; + /** * Calls ListBackups. * @param request ListBackupsRequest message or plain object @@ -2715,6 +2799,76 @@ export namespace google { * @returns Promise */ public updateBackup(request: google.cloud.filestore.v1beta1.IUpdateBackupRequest): Promise; + + /** + * Calls ListShares. + * @param request ListSharesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSharesResponse + */ + public listShares(request: google.cloud.filestore.v1beta1.IListSharesRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSharesCallback): void; + + /** + * Calls ListShares. + * @param request ListSharesRequest message or plain object + * @returns Promise + */ + public listShares(request: google.cloud.filestore.v1beta1.IListSharesRequest): Promise; + + /** + * Calls GetShare. + * @param request GetShareRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Share + */ + public getShare(request: google.cloud.filestore.v1beta1.IGetShareRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.GetShareCallback): void; + + /** + * Calls GetShare. + * @param request GetShareRequest message or plain object + * @returns Promise + */ + public getShare(request: google.cloud.filestore.v1beta1.IGetShareRequest): Promise; + + /** + * Calls CreateShare. + * @param request CreateShareRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createShare(request: google.cloud.filestore.v1beta1.ICreateShareRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateShareCallback): void; + + /** + * Calls CreateShare. + * @param request CreateShareRequest message or plain object + * @returns Promise + */ + public createShare(request: google.cloud.filestore.v1beta1.ICreateShareRequest): Promise; + + /** + * Calls DeleteShare. + * @param request DeleteShareRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteShare(request: google.cloud.filestore.v1beta1.IDeleteShareRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteShareCallback): void; + + /** + * Calls DeleteShare. + * @param request DeleteShareRequest message or plain object + * @returns Promise + */ + public deleteShare(request: google.cloud.filestore.v1beta1.IDeleteShareRequest): Promise; + + /** + * Calls UpdateShare. + * @param request UpdateShareRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateShare(request: google.cloud.filestore.v1beta1.IUpdateShareRequest, callback: google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateShareCallback): void; + + /** + * Calls UpdateShare. + * @param request UpdateShareRequest message or plain object + * @returns Promise + */ + public updateShare(request: google.cloud.filestore.v1beta1.IUpdateShareRequest): Promise; } namespace CloudFilestoreManager { @@ -2754,6 +2908,13 @@ export namespace google { */ type RestoreInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|revertInstance}. + * @param error Error, if any + * @param [response] Operation + */ + type RevertInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteInstance}. * @param error Error, if any @@ -2761,6 +2922,41 @@ export namespace google { */ type DeleteInstanceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listSnapshots}. + * @param error Error, if any + * @param [response] ListSnapshotsResponse + */ + type ListSnapshotsCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListSnapshotsResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getSnapshot}. + * @param error Error, if any + * @param [response] Snapshot + */ + type GetSnapshotCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Snapshot) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateSnapshot}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateSnapshotCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listBackups}. * @param error Error, if any @@ -2795,6 +2991,41 @@ export namespace google { * @param [response] Operation */ type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listShares}. + * @param error Error, if any + * @param [response] ListSharesResponse + */ + type ListSharesCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.ListSharesResponse) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getShare}. + * @param error Error, if any + * @param [response] Share + */ + type GetShareCallback = (error: (Error|null), response?: google.cloud.filestore.v1beta1.Share) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createShare}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateShareCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteShare}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteShareCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateShare}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateShareCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } /** Properties of a NetworkConfig. */ @@ -2811,6 +3042,9 @@ export namespace google { /** NetworkConfig ipAddresses */ ipAddresses?: (string[]|null); + + /** NetworkConfig connectMode */ + connectMode?: (google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode|keyof typeof google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode|null); } /** Represents a NetworkConfig. */ @@ -2834,6 +3068,9 @@ export namespace google { /** NetworkConfig ipAddresses. */ public ipAddresses: string[]; + /** NetworkConfig connectMode. */ + public connectMode: (google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode|keyof typeof google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode); + /** * Creates a new NetworkConfig instance using the specified properties. * @param [properties] Properties to set @@ -2919,6 +3156,13 @@ export namespace google { ADDRESS_MODE_UNSPECIFIED = 0, MODE_IPV4 = 1 } + + /** ConnectMode enum. */ + enum ConnectMode { + CONNECT_MODE_UNSPECIFIED = 0, + DIRECT_PEERING = 1, + PRIVATE_SERVICE_ACCESS = 2 + } } /** Properties of a FileShareConfig. */ @@ -3212,6 +3456,27 @@ export namespace google { /** Instance satisfiesPzs */ satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** Instance kmsKeyName */ + kmsKeyName?: (string|null); + + /** Instance suspensionReasons */ + suspensionReasons?: (google.cloud.filestore.v1beta1.Instance.SuspensionReason[]|null); + + /** Instance maxCapacityGb */ + maxCapacityGb?: (number|Long|string|null); + + /** Instance capacityStepSizeGb */ + capacityStepSizeGb?: (number|Long|string|null); + + /** Instance maxShareCount */ + maxShareCount?: (number|Long|string|null); + + /** Instance capacityGb */ + capacityGb?: (number|Long|string|null); + + /** Instance multiShareEnabled */ + multiShareEnabled?: (boolean|null); } /** Represents an Instance. */ @@ -3256,6 +3521,27 @@ export namespace google { /** Instance satisfiesPzs. */ public satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** Instance kmsKeyName. */ + public kmsKeyName: string; + + /** Instance suspensionReasons. */ + public suspensionReasons: google.cloud.filestore.v1beta1.Instance.SuspensionReason[]; + + /** Instance maxCapacityGb. */ + public maxCapacityGb: (number|Long|string); + + /** Instance capacityStepSizeGb. */ + public capacityStepSizeGb: (number|Long|string); + + /** Instance maxShareCount. */ + public maxShareCount: (number|Long|string); + + /** Instance capacityGb. */ + public capacityGb: (number|Long|string); + + /** Instance multiShareEnabled. */ + public multiShareEnabled: boolean; + /** * Creates a new Instance instance using the specified properties. * @param [properties] Properties to set @@ -3344,7 +3630,11 @@ export namespace google { REPAIRING = 3, DELETING = 4, ERROR = 6, - RESTORING = 7 + RESTORING = 7, + SUSPENDED = 8, + REVERTING = 9, + SUSPENDING = 10, + RESUMING = 11 } /** Tier enum. */ @@ -3354,7 +3644,14 @@ export namespace google { PREMIUM = 2, BASIC_HDD = 3, BASIC_SSD = 4, - HIGH_SCALE_SSD = 6 + HIGH_SCALE_SSD = 6, + ENTERPRISE = 7 + } + + /** SuspensionReason enum. */ + enum SuspensionReason { + SUSPENSION_REASON_UNSPECIFIED = 0, + KMS_KEY_ISSUE = 1 } } @@ -3785,11 +4082,117 @@ export namespace google { public static getTypeUrl(typeUrlPrefix?: string): string; } + /** Properties of a RevertInstanceRequest. */ + interface IRevertInstanceRequest { + + /** RevertInstanceRequest name */ + name?: (string|null); + + /** RevertInstanceRequest targetSnapshotId */ + targetSnapshotId?: (string|null); + } + + /** Represents a RevertInstanceRequest. */ + class RevertInstanceRequest implements IRevertInstanceRequest { + + /** + * Constructs a new RevertInstanceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IRevertInstanceRequest); + + /** RevertInstanceRequest name. */ + public name: string; + + /** RevertInstanceRequest targetSnapshotId. */ + public targetSnapshotId: string; + + /** + * Creates a new RevertInstanceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RevertInstanceRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IRevertInstanceRequest): google.cloud.filestore.v1beta1.RevertInstanceRequest; + + /** + * Encodes the specified RevertInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.RevertInstanceRequest.verify|verify} messages. + * @param message RevertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IRevertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RevertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.RevertInstanceRequest.verify|verify} messages. + * @param message RevertInstanceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IRevertInstanceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RevertInstanceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RevertInstanceRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.RevertInstanceRequest; + + /** + * Decodes a RevertInstanceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RevertInstanceRequest + * @throws {Error} If the payload 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.filestore.v1beta1.RevertInstanceRequest; + + /** + * Verifies a RevertInstanceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RevertInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RevertInstanceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.RevertInstanceRequest; + + /** + * Creates a plain object from a RevertInstanceRequest message. Also converts values to other types if specified. + * @param message RevertInstanceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.RevertInstanceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RevertInstanceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RevertInstanceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + /** Properties of a DeleteInstanceRequest. */ interface IDeleteInstanceRequest { /** DeleteInstanceRequest name */ name?: (string|null); + + /** DeleteInstanceRequest force */ + force?: (boolean|null); } /** Represents a DeleteInstanceRequest. */ @@ -3804,6 +4207,9 @@ export namespace google { /** DeleteInstanceRequest name. */ public name: string; + /** DeleteInstanceRequest force. */ + public force: boolean; + /** * Creates a new DeleteInstanceRequest instance using the specified properties. * @param [properties] Properties to set @@ -4250,811 +4656,2233 @@ export namespace google { } } - /** Properties of a Backup. */ - interface IBackup { + /** Properties of a CreateSnapshotRequest. */ + interface ICreateSnapshotRequest { - /** Backup name */ - name?: (string|null); + /** CreateSnapshotRequest parent */ + parent?: (string|null); - /** Backup description */ - description?: (string|null); + /** CreateSnapshotRequest snapshotId */ + snapshotId?: (string|null); - /** Backup state */ - state?: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State|null); + /** CreateSnapshotRequest snapshot */ + snapshot?: (google.cloud.filestore.v1beta1.ISnapshot|null); + } - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); + /** Represents a CreateSnapshotRequest. */ + class CreateSnapshotRequest implements ICreateSnapshotRequest { - /** Backup labels */ - labels?: ({ [k: string]: string }|null); + /** + * Constructs a new CreateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.ICreateSnapshotRequest); - /** Backup capacityGb */ - capacityGb?: (number|Long|string|null); + /** CreateSnapshotRequest parent. */ + public parent: string; - /** Backup storageBytes */ - storageBytes?: (number|Long|string|null); + /** CreateSnapshotRequest snapshotId. */ + public snapshotId: string; - /** Backup sourceInstance */ - sourceInstance?: (string|null); + /** CreateSnapshotRequest snapshot. */ + public snapshot?: (google.cloud.filestore.v1beta1.ISnapshot|null); - /** Backup sourceFileShare */ - sourceFileShare?: (string|null); + /** + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSnapshotRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.ICreateSnapshotRequest): google.cloud.filestore.v1beta1.CreateSnapshotRequest; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateSnapshotRequest.verify|verify} messages. + * @param message CreateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.ICreateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSnapshotRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.CreateSnapshotRequest; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSnapshotRequest + * @throws {Error} If the payload 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.filestore.v1beta1.CreateSnapshotRequest; + + /** + * Verifies a CreateSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.CreateSnapshotRequest; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @param message CreateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.CreateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetSnapshotRequest. */ + interface IGetSnapshotRequest { + + /** GetSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a GetSnapshotRequest. */ + class GetSnapshotRequest implements IGetSnapshotRequest { + + /** + * Constructs a new GetSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IGetSnapshotRequest); + + /** GetSnapshotRequest name. */ + public name: string; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSnapshotRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IGetSnapshotRequest): google.cloud.filestore.v1beta1.GetSnapshotRequest; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetSnapshotRequest.verify|verify} messages. + * @param message GetSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IGetSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.GetSnapshotRequest; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.GetSnapshotRequest; + + /** + * Verifies a GetSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.GetSnapshotRequest; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @param message GetSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.GetSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteSnapshotRequest. */ + interface IDeleteSnapshotRequest { + + /** DeleteSnapshotRequest name */ + name?: (string|null); + } + + /** Represents a DeleteSnapshotRequest. */ + class DeleteSnapshotRequest implements IDeleteSnapshotRequest { + + /** + * Constructs a new DeleteSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest); + + /** DeleteSnapshotRequest name. */ + public name: string; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSnapshotRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest): google.cloud.filestore.v1beta1.DeleteSnapshotRequest; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteSnapshotRequest.verify|verify} messages. + * @param message DeleteSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.DeleteSnapshotRequest; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.DeleteSnapshotRequest; + + /** + * Verifies a DeleteSnapshotRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.DeleteSnapshotRequest; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @param message DeleteSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.DeleteSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateSnapshotRequest. */ + interface IUpdateSnapshotRequest { + + /** UpdateSnapshotRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSnapshotRequest snapshot */ + snapshot?: (google.cloud.filestore.v1beta1.ISnapshot|null); + } + + /** Represents an UpdateSnapshotRequest. */ + class UpdateSnapshotRequest implements IUpdateSnapshotRequest { + + /** + * Constructs a new UpdateSnapshotRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest); + + /** UpdateSnapshotRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateSnapshotRequest snapshot. */ + public snapshot?: (google.cloud.filestore.v1beta1.ISnapshot|null); + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSnapshotRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest): google.cloud.filestore.v1beta1.UpdateSnapshotRequest; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateSnapshotRequest.verify|verify} messages. + * @param message UpdateSnapshotRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSnapshotRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.UpdateSnapshotRequest; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSnapshotRequest + * @throws {Error} If the payload 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.filestore.v1beta1.UpdateSnapshotRequest; + + /** + * Verifies an UpdateSnapshotRequest message. + * @param message Plain 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 UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSnapshotRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.UpdateSnapshotRequest; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @param message UpdateSnapshotRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.UpdateSnapshotRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsRequest. */ + interface IListSnapshotsRequest { + + /** ListSnapshotsRequest parent */ + parent?: (string|null); + + /** ListSnapshotsRequest pageSize */ + pageSize?: (number|null); + + /** ListSnapshotsRequest pageToken */ + pageToken?: (string|null); + + /** ListSnapshotsRequest orderBy */ + orderBy?: (string|null); + + /** ListSnapshotsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSnapshotsRequest. */ + class ListSnapshotsRequest implements IListSnapshotsRequest { + + /** + * Constructs a new ListSnapshotsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListSnapshotsRequest); + + /** ListSnapshotsRequest parent. */ + public parent: string; + + /** ListSnapshotsRequest pageSize. */ + public pageSize: number; + + /** ListSnapshotsRequest pageToken. */ + public pageToken: string; + + /** ListSnapshotsRequest orderBy. */ + public orderBy: string; + + /** ListSnapshotsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListSnapshotsRequest): google.cloud.filestore.v1beta1.ListSnapshotsRequest; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsRequest.verify|verify} messages. + * @param message ListSnapshotsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListSnapshotsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.ListSnapshotsRequest; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.ListSnapshotsRequest; + + /** + * Verifies a ListSnapshotsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListSnapshotsRequest; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @param message ListSnapshotsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListSnapshotsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListSnapshotsResponse. */ + interface IListSnapshotsResponse { + + /** ListSnapshotsResponse snapshots */ + snapshots?: (google.cloud.filestore.v1beta1.ISnapshot[]|null); + + /** ListSnapshotsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSnapshotsResponse. */ + class ListSnapshotsResponse implements IListSnapshotsResponse { + + /** + * Constructs a new ListSnapshotsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListSnapshotsResponse); + + /** ListSnapshotsResponse snapshots. */ + public snapshots: google.cloud.filestore.v1beta1.ISnapshot[]; + + /** ListSnapshotsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSnapshotsResponse instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListSnapshotsResponse): google.cloud.filestore.v1beta1.ListSnapshotsResponse; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsResponse.verify|verify} messages. + * @param message ListSnapshotsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListSnapshotsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.ListSnapshotsResponse; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.ListSnapshotsResponse; + + /** + * Verifies a ListSnapshotsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSnapshotsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListSnapshotsResponse; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @param message ListSnapshotsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListSnapshotsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup state */ + state?: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup capacityGb */ + capacityGb?: (number|Long|string|null); + + /** Backup storageBytes */ + storageBytes?: (number|Long|string|null); + + /** Backup sourceInstance */ + sourceInstance?: (string|null); + + /** Backup sourceFileShare */ + sourceFileShare?: (string|null); /** Backup sourceInstanceTier */ sourceInstanceTier?: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier|null); - /** Backup downloadBytes */ - downloadBytes?: (number|Long|string|null); + /** Backup downloadBytes */ + downloadBytes?: (number|Long|string|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** Backup kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description: string; + + /** Backup state. */ + public state: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup capacityGb. */ + public capacityGb: (number|Long|string); + + /** Backup storageBytes. */ + public storageBytes: (number|Long|string); + + /** Backup sourceInstance. */ + public sourceInstance: string; + + /** Backup sourceFileShare. */ + public sourceFileShare: string; + + /** Backup sourceInstanceTier. */ + public sourceInstanceTier: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier); + + /** Backup downloadBytes. */ + public downloadBytes: (number|Long|string); + + /** Backup satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** Backup kmsKeyName. */ + public kmsKeyName: string; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IBackup): google.cloud.filestore.v1beta1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not 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.filestore.v1beta1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload 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.filestore.v1beta1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + FINALIZING = 2, + READY = 3, + DELETING = 4 + } + } + + /** Properties of a CreateBackupRequest. */ + interface ICreateBackupRequest { + + /** CreateBackupRequest parent */ + parent?: (string|null); + + /** CreateBackupRequest backup */ + backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** CreateBackupRequest backupId */ + backupId?: (string|null); + } + + /** Represents a CreateBackupRequest. */ + class CreateBackupRequest implements ICreateBackupRequest { + + /** + * Constructs a new CreateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest); + + /** CreateBackupRequest parent. */ + public parent: string; + + /** CreateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** CreateBackupRequest backupId. */ + public backupId: string; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest): google.cloud.filestore.v1beta1.CreateBackupRequest; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @param message CreateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.CreateBackupRequest; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.CreateBackupRequest; + + /** + * Verifies a CreateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.CreateBackupRequest; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @param message CreateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest): google.cloud.filestore.v1beta1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest): google.cloud.filestore.v1beta1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest): google.cloud.filestore.v1beta1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload 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.filestore.v1beta1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest): google.cloud.filestore.v1beta1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsRequest; - /** Backup satisfiesPzs */ - satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Represents a Backup. */ - class Backup implements IBackup { + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.filestore.v1beta1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { /** - * Constructs a new Backup. + * Constructs a new ListBackupsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IBackup); + constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse); - /** Backup name. */ - public name: string; + /** ListBackupsResponse backups. */ + public backups: google.cloud.filestore.v1beta1.IBackup[]; - /** Backup description. */ - public description: string; + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; - /** Backup state. */ - public state: (google.cloud.filestore.v1beta1.Backup.State|keyof typeof google.cloud.filestore.v1beta1.Backup.State); + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse): google.cloud.filestore.v1beta1.ListBackupsResponse; - /** Backup labels. */ - public labels: { [k: string]: string }; + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup capacityGb. */ - public capacityGb: (number|Long|string); + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Backup storageBytes. */ - public storageBytes: (number|Long|string); + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsResponse; - /** Backup sourceInstance. */ - public sourceInstance: string; + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsResponse; - /** Backup sourceFileShare. */ - public sourceFileShare: string; + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Backup sourceInstanceTier. */ - public sourceInstanceTier: (google.cloud.filestore.v1beta1.Instance.Tier|keyof typeof google.cloud.filestore.v1beta1.Instance.Tier); + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsResponse; - /** Backup downloadBytes. */ - public downloadBytes: (number|Long|string); + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Backup satisfiesPzs. */ - public satisfiesPzs?: (google.protobuf.IBoolValue|null); + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; /** - * Creates a new Backup instance using the specified properties. + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Share. */ + interface IShare { + + /** Share name */ + name?: (string|null); + + /** Share mountName */ + mountName?: (string|null); + + /** Share description */ + description?: (string|null); + + /** Share capacityGb */ + capacityGb?: (number|Long|string|null); + + /** Share nfsExportOptions */ + nfsExportOptions?: (google.cloud.filestore.v1beta1.INfsExportOptions[]|null); + + /** Share state */ + state?: (google.cloud.filestore.v1beta1.Share.State|keyof typeof google.cloud.filestore.v1beta1.Share.State|null); + + /** Share createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Share labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a Share. */ + class Share implements IShare { + + /** + * Constructs a new Share. * @param [properties] Properties to set - * @returns Backup instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IBackup): google.cloud.filestore.v1beta1.Backup; + constructor(properties?: google.cloud.filestore.v1beta1.IShare); + + /** Share name. */ + public name: string; + + /** Share mountName. */ + public mountName: string; + + /** Share description. */ + public description: string; + + /** Share capacityGb. */ + public capacityGb: (number|Long|string); + + /** Share nfsExportOptions. */ + public nfsExportOptions: google.cloud.filestore.v1beta1.INfsExportOptions[]; + + /** Share state. */ + public state: (google.cloud.filestore.v1beta1.Share.State|keyof typeof google.cloud.filestore.v1beta1.Share.State); + + /** Share createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Share labels. */ + public labels: { [k: string]: string }; /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode + * Creates a new Share instance using the specified properties. + * @param [properties] Properties to set + * @returns Share instance + */ + public static create(properties?: google.cloud.filestore.v1beta1.IShare): google.cloud.filestore.v1beta1.Share; + + /** + * Encodes the specified Share message. Does not implicitly {@link google.cloud.filestore.v1beta1.Share.verify|verify} messages. + * @param message Share message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IShare, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode + * Encodes the specified Share message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Share.verify|verify} messages. + * @param message Share message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IShare, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Backup message from the specified reader or buffer. + * Decodes a Share message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Backup + * @returns Share * @throws {Error} If the payload is not 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.filestore.v1beta1.Backup; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.Share; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. + * Decodes a Share message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Backup + * @returns Share * @throws {Error} If the payload 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.filestore.v1beta1.Backup; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.Share; /** - * Verifies a Backup message. + * Verifies a Share message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * Creates a Share message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Backup + * @returns Share */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.Backup; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.Share; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup + * Creates a plain object from a Share message. Also converts values to other types if specified. + * @param message Share * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.Share, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Backup to JSON. + * Converts this Share to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for Backup + * Gets the default type url for Share * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - namespace Backup { + namespace Share { /** State enum. */ enum State { STATE_UNSPECIFIED = 0, CREATING = 1, - FINALIZING = 2, READY = 3, DELETING = 4 } } - /** Properties of a CreateBackupRequest. */ - interface ICreateBackupRequest { + /** Properties of a CreateShareRequest. */ + interface ICreateShareRequest { - /** CreateBackupRequest parent */ + /** CreateShareRequest parent */ parent?: (string|null); - /** CreateBackupRequest backup */ - backup?: (google.cloud.filestore.v1beta1.IBackup|null); + /** CreateShareRequest shareId */ + shareId?: (string|null); - /** CreateBackupRequest backupId */ - backupId?: (string|null); + /** CreateShareRequest share */ + share?: (google.cloud.filestore.v1beta1.IShare|null); } - /** Represents a CreateBackupRequest. */ - class CreateBackupRequest implements ICreateBackupRequest { + /** Represents a CreateShareRequest. */ + class CreateShareRequest implements ICreateShareRequest { /** - * Constructs a new CreateBackupRequest. + * Constructs a new CreateShareRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest); + constructor(properties?: google.cloud.filestore.v1beta1.ICreateShareRequest); - /** CreateBackupRequest parent. */ + /** CreateShareRequest parent. */ public parent: string; - /** CreateBackupRequest backup. */ - public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + /** CreateShareRequest shareId. */ + public shareId: string; - /** CreateBackupRequest backupId. */ - public backupId: string; + /** CreateShareRequest share. */ + public share?: (google.cloud.filestore.v1beta1.IShare|null); /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new CreateShareRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateBackupRequest instance + * @returns CreateShareRequest instance */ - public static create(properties?: google.cloud.filestore.v1beta1.ICreateBackupRequest): google.cloud.filestore.v1beta1.CreateBackupRequest; + public static create(properties?: google.cloud.filestore.v1beta1.ICreateShareRequest): google.cloud.filestore.v1beta1.CreateShareRequest; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified CreateShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateShareRequest.verify|verify} messages. + * @param message CreateShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.ICreateShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. - * @param message CreateBackupRequest message or plain object to encode + * Encodes the specified CreateShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateShareRequest.verify|verify} messages. + * @param message CreateShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.ICreateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.ICreateShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a CreateShareRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateBackupRequest + * @returns CreateShareRequest * @throws {Error} If the payload is not 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.filestore.v1beta1.CreateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.CreateShareRequest; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateShareRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateBackupRequest + * @returns CreateShareRequest * @throws {Error} If the payload 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.filestore.v1beta1.CreateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.CreateShareRequest; /** - * Verifies a CreateBackupRequest message. + * Verifies a CreateShareRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateShareRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateBackupRequest + * @returns CreateShareRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.CreateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.CreateShareRequest; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. - * @param message CreateBackupRequest + * Creates a plain object from a CreateShareRequest message. Also converts values to other types if specified. + * @param message CreateShareRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.CreateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.CreateShareRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this CreateShareRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for CreateShareRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { + /** Properties of a GetShareRequest. */ + interface IGetShareRequest { - /** DeleteBackupRequest name */ + /** GetShareRequest name */ name?: (string|null); } - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { + /** Represents a GetShareRequest. */ + class GetShareRequest implements IGetShareRequest { /** - * Constructs a new DeleteBackupRequest. + * Constructs a new GetShareRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest); + constructor(properties?: google.cloud.filestore.v1beta1.IGetShareRequest); - /** DeleteBackupRequest name. */ + /** GetShareRequest name. */ public name: string; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new GetShareRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteBackupRequest instance + * @returns GetShareRequest instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IDeleteBackupRequest): google.cloud.filestore.v1beta1.DeleteBackupRequest; + public static create(properties?: google.cloud.filestore.v1beta1.IGetShareRequest): google.cloud.filestore.v1beta1.GetShareRequest; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified GetShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetShareRequest.verify|verify} messages. + * @param message GetShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IGetShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode + * Encodes the specified GetShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetShareRequest.verify|verify} messages. + * @param message GetShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IGetShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes a GetShareRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest + * @returns GetShareRequest * @throws {Error} If the payload is not 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.filestore.v1beta1.DeleteBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.GetShareRequest; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetShareRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest + * @returns GetShareRequest * @throws {Error} If the payload 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.filestore.v1beta1.DeleteBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.GetShareRequest; /** - * Verifies a DeleteBackupRequest message. + * Verifies a GetShareRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetShareRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteBackupRequest + * @returns GetShareRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.DeleteBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.GetShareRequest; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest + * Creates a plain object from a GetShareRequest message. Also converts values to other types if specified. + * @param message GetShareRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.GetShareRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this GetShareRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for GetShareRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.filestore.v1beta1.IBackup|null); + /** Properties of a DeleteShareRequest. */ + interface IDeleteShareRequest { - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteShareRequest name */ + name?: (string|null); } - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { + /** Represents a DeleteShareRequest. */ + class DeleteShareRequest implements IDeleteShareRequest { /** - * Constructs a new UpdateBackupRequest. + * Constructs a new DeleteShareRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest); - - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.filestore.v1beta1.IBackup|null); + constructor(properties?: google.cloud.filestore.v1beta1.IDeleteShareRequest); - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteShareRequest name. */ + public name: string; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new DeleteShareRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateBackupRequest instance + * @returns DeleteShareRequest instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IUpdateBackupRequest): google.cloud.filestore.v1beta1.UpdateBackupRequest; + public static create(properties?: google.cloud.filestore.v1beta1.IDeleteShareRequest): google.cloud.filestore.v1beta1.DeleteShareRequest; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified DeleteShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteShareRequest.verify|verify} messages. + * @param message DeleteShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IDeleteShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode + * Encodes the specified DeleteShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteShareRequest.verify|verify} messages. + * @param message DeleteShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IDeleteShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a DeleteShareRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest + * @returns DeleteShareRequest * @throws {Error} If the payload is not 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.filestore.v1beta1.UpdateBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.DeleteShareRequest; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteShareRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest + * @returns DeleteShareRequest * @throws {Error} If the payload 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.filestore.v1beta1.UpdateBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.DeleteShareRequest; /** - * Verifies an UpdateBackupRequest message. + * Verifies a DeleteShareRequest message. * @param message Plain 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteShareRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateBackupRequest + * @returns DeleteShareRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.UpdateBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.DeleteShareRequest; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest + * Creates a plain object from a DeleteShareRequest message. Also converts values to other types if specified. + * @param message DeleteShareRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.DeleteShareRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this DeleteShareRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for DeleteShareRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { + /** Properties of a ListSharesRequest. */ + interface IListSharesRequest { - /** GetBackupRequest name */ - name?: (string|null); + /** ListSharesRequest parent */ + parent?: (string|null); + + /** ListSharesRequest pageSize */ + pageSize?: (number|null); + + /** ListSharesRequest pageToken */ + pageToken?: (string|null); + + /** ListSharesRequest orderBy */ + orderBy?: (string|null); + + /** ListSharesRequest filter */ + filter?: (string|null); } - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { + /** Represents a ListSharesRequest. */ + class ListSharesRequest implements IListSharesRequest { /** - * Constructs a new GetBackupRequest. + * Constructs a new ListSharesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest); + constructor(properties?: google.cloud.filestore.v1beta1.IListSharesRequest); - /** GetBackupRequest name. */ - public name: string; + /** ListSharesRequest parent. */ + public parent: string; + + /** ListSharesRequest pageSize. */ + public pageSize: number; + + /** ListSharesRequest pageToken. */ + public pageToken: string; + + /** ListSharesRequest orderBy. */ + public orderBy: string; + + /** ListSharesRequest filter. */ + public filter: string; /** - * Creates a new GetBackupRequest instance using the specified properties. + * Creates a new ListSharesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetBackupRequest instance + * @returns ListSharesRequest instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IGetBackupRequest): google.cloud.filestore.v1beta1.GetBackupRequest; + public static create(properties?: google.cloud.filestore.v1beta1.IListSharesRequest): google.cloud.filestore.v1beta1.ListSharesRequest; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified ListSharesRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesRequest.verify|verify} messages. + * @param message ListSharesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IListSharesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode + * Encodes the specified ListSharesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesRequest.verify|verify} messages. + * @param message ListSharesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListSharesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a ListSharesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetBackupRequest + * @returns ListSharesRequest * @throws {Error} If the payload is not 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.filestore.v1beta1.GetBackupRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.ListSharesRequest; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSharesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetBackupRequest + * @returns ListSharesRequest * @throws {Error} If the payload 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.filestore.v1beta1.GetBackupRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.ListSharesRequest; /** - * Verifies a GetBackupRequest message. + * Verifies a ListSharesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSharesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetBackupRequest + * @returns ListSharesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.GetBackupRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListSharesRequest; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest + * Creates a plain object from a ListSharesRequest message. Also converts values to other types if specified. + * @param message ListSharesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.ListSharesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetBackupRequest to JSON. + * Converts this ListSharesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for ListSharesRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); + /** Properties of a ListSharesResponse. */ + interface IListSharesResponse { - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); + /** ListSharesResponse shares */ + shares?: (google.cloud.filestore.v1beta1.IShare[]|null); - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); + /** ListSharesResponse nextPageToken */ + nextPageToken?: (string|null); - /** ListBackupsRequest filter */ - filter?: (string|null); + /** ListSharesResponse unreachable */ + unreachable?: (string[]|null); } - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { + /** Represents a ListSharesResponse. */ + class ListSharesResponse implements IListSharesResponse { /** - * Constructs a new ListBackupsRequest. + * Constructs a new ListSharesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; + constructor(properties?: google.cloud.filestore.v1beta1.IListSharesResponse); - /** ListBackupsRequest pageToken. */ - public pageToken: string; + /** ListSharesResponse shares. */ + public shares: google.cloud.filestore.v1beta1.IShare[]; - /** ListBackupsRequest orderBy. */ - public orderBy: string; + /** ListSharesResponse nextPageToken. */ + public nextPageToken: string; - /** ListBackupsRequest filter. */ - public filter: string; + /** ListSharesResponse unreachable. */ + public unreachable: string[]; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListSharesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsRequest instance + * @returns ListSharesResponse instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsRequest): google.cloud.filestore.v1beta1.ListBackupsRequest; + public static create(properties?: google.cloud.filestore.v1beta1.IListSharesResponse): google.cloud.filestore.v1beta1.ListSharesResponse; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListSharesResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesResponse.verify|verify} messages. + * @param message ListSharesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IListSharesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode + * Encodes the specified ListSharesResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesResponse.verify|verify} messages. + * @param message ListSharesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListSharesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListSharesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsRequest + * @returns ListSharesResponse * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.ListSharesResponse; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSharesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest + * @returns ListSharesResponse * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.ListSharesResponse; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListSharesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSharesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsRequest + * @returns ListSharesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListSharesResponse; /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest + * Creates a plain object from a ListSharesResponse message. Also converts values to other types if specified. + * @param message ListSharesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.ListSharesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListSharesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListSharesResponse * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ public static getTypeUrl(typeUrlPrefix?: string): string; } - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.cloud.filestore.v1beta1.IBackup[]|null); + /** Properties of an UpdateShareRequest. */ + interface IUpdateShareRequest { - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); + /** UpdateShareRequest share */ + share?: (google.cloud.filestore.v1beta1.IShare|null); - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); + /** UpdateShareRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { + /** Represents an UpdateShareRequest. */ + class UpdateShareRequest implements IUpdateShareRequest { /** - * Constructs a new ListBackupsResponse. + * Constructs a new UpdateShareRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse); + constructor(properties?: google.cloud.filestore.v1beta1.IUpdateShareRequest); - /** ListBackupsResponse backups. */ - public backups: google.cloud.filestore.v1beta1.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; + /** UpdateShareRequest share. */ + public share?: (google.cloud.filestore.v1beta1.IShare|null); - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; + /** UpdateShareRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new UpdateShareRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListBackupsResponse instance + * @returns UpdateShareRequest instance */ - public static create(properties?: google.cloud.filestore.v1beta1.IListBackupsResponse): google.cloud.filestore.v1beta1.ListBackupsResponse; + public static create(properties?: google.cloud.filestore.v1beta1.IUpdateShareRequest): google.cloud.filestore.v1beta1.UpdateShareRequest; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified UpdateShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateShareRequest.verify|verify} messages. + * @param message UpdateShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.filestore.v1beta1.IUpdateShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode + * Encodes the specified UpdateShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateShareRequest.verify|verify} messages. + * @param message UpdateShareRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.filestore.v1beta1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.filestore.v1beta1.IUpdateShareRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes an UpdateShareRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListBackupsResponse + * @returns UpdateShareRequest * @throws {Error} If the payload is not 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.filestore.v1beta1.ListBackupsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.filestore.v1beta1.UpdateShareRequest; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateShareRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse + * @returns UpdateShareRequest * @throws {Error} If the payload 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.filestore.v1beta1.ListBackupsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.filestore.v1beta1.UpdateShareRequest; /** - * Verifies a ListBackupsResponse message. + * Verifies an UpdateShareRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateShareRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListBackupsResponse + * @returns UpdateShareRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.ListBackupsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.filestore.v1beta1.UpdateShareRequest; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse + * Creates a plain object from an UpdateShareRequest message. Also converts values to other types if specified. + * @param message UpdateShareRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.filestore.v1beta1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.filestore.v1beta1.UpdateShareRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this UpdateShareRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for UpdateShareRequest * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns The default type url */ diff --git a/packages/google-cloud-filestore/protos/protos.js b/packages/google-cloud-filestore/protos/protos.js index 2e5c6bff608..6d55de8a69e 100644 --- a/packages/google-cloud-filestore/protos/protos.js +++ b/packages/google-cloud-filestore/protos/protos.js @@ -6658,6 +6658,39 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|revertInstance}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef RevertInstanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RevertInstance. + * @function revertInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest} request RevertInstanceRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.RevertInstanceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.revertInstance = function revertInstance(request, callback) { + return this.rpcCall(revertInstance, $root.google.cloud.filestore.v1beta1.RevertInstanceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RevertInstance" }); + + /** + * Calls RevertInstance. + * @function revertInstance + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest} request RevertInstanceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteInstance}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager @@ -6691,6 +6724,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listSnapshots}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef ListSnapshotsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.ListSnapshotsResponse} [response] ListSnapshotsResponse + */ + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSnapshotsCallback} callback Node-style callback called with the error, if any, and ListSnapshotsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listSnapshots = function listSnapshots(request, callback) { + return this.rpcCall(listSnapshots, $root.google.cloud.filestore.v1beta1.ListSnapshotsRequest, $root.google.cloud.filestore.v1beta1.ListSnapshotsResponse, request, callback); + }, "name", { value: "ListSnapshots" }); + + /** + * Calls ListSnapshots. + * @function listSnapshots + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest} request ListSnapshotsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getSnapshot}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef GetSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.Snapshot} [response] Snapshot + */ + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.GetSnapshotCallback} callback Node-style callback called with the error, if any, and Snapshot + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getSnapshot = function getSnapshot(request, callback) { + return this.rpcCall(getSnapshot, $root.google.cloud.filestore.v1beta1.GetSnapshotRequest, $root.google.cloud.filestore.v1beta1.Snapshot, request, callback); + }, "name", { value: "GetSnapshot" }); + + /** + * Calls GetSnapshot. + * @function getSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest} request GetSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createSnapshot}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef CreateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createSnapshot = function createSnapshot(request, callback) { + return this.rpcCall(createSnapshot, $root.google.cloud.filestore.v1beta1.CreateSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateSnapshot" }); + + /** + * Calls CreateSnapshot. + * @function createSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest} request CreateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteSnapshot}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef DeleteSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteSnapshot = function deleteSnapshot(request, callback) { + return this.rpcCall(deleteSnapshot, $root.google.cloud.filestore.v1beta1.DeleteSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteSnapshot" }); + + /** + * Calls DeleteSnapshot. + * @function deleteSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest} request DeleteSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateSnapshot}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef UpdateSnapshotCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateSnapshotCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateSnapshot = function updateSnapshot(request, callback) { + return this.rpcCall(updateSnapshot, $root.google.cloud.filestore.v1beta1.UpdateSnapshotRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateSnapshot" }); + + /** + * Calls UpdateSnapshot. + * @function updateSnapshot + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest} request UpdateSnapshotRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listBackups}. * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager @@ -6856,6 +7054,171 @@ * @variation 2 */ + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|listShares}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef ListSharesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.ListSharesResponse} [response] ListSharesResponse + */ + + /** + * Calls ListShares. + * @function listShares + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListSharesRequest} request ListSharesRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSharesCallback} callback Node-style callback called with the error, if any, and ListSharesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.listShares = function listShares(request, callback) { + return this.rpcCall(listShares, $root.google.cloud.filestore.v1beta1.ListSharesRequest, $root.google.cloud.filestore.v1beta1.ListSharesResponse, request, callback); + }, "name", { value: "ListShares" }); + + /** + * Calls ListShares. + * @function listShares + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IListSharesRequest} request ListSharesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|getShare}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef GetShareCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.filestore.v1beta1.Share} [response] Share + */ + + /** + * Calls GetShare. + * @function getShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetShareRequest} request GetShareRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.GetShareCallback} callback Node-style callback called with the error, if any, and Share + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.getShare = function getShare(request, callback) { + return this.rpcCall(getShare, $root.google.cloud.filestore.v1beta1.GetShareRequest, $root.google.cloud.filestore.v1beta1.Share, request, callback); + }, "name", { value: "GetShare" }); + + /** + * Calls GetShare. + * @function getShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IGetShareRequest} request GetShareRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|createShare}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef CreateShareCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateShare. + * @function createShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest} request CreateShareRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateShareCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.createShare = function createShare(request, callback) { + return this.rpcCall(createShare, $root.google.cloud.filestore.v1beta1.CreateShareRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateShare" }); + + /** + * Calls CreateShare. + * @function createShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest} request CreateShareRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|deleteShare}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef DeleteShareCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteShare. + * @function deleteShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest} request DeleteShareRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteShareCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.deleteShare = function deleteShare(request, callback) { + return this.rpcCall(deleteShare, $root.google.cloud.filestore.v1beta1.DeleteShareRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteShare" }); + + /** + * Calls DeleteShare. + * @function deleteShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest} request DeleteShareRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.filestore.v1beta1.CloudFilestoreManager|updateShare}. + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @typedef UpdateShareCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateShare. + * @function updateShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest} request UpdateShareRequest message or plain object + * @param {google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateShareCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(CloudFilestoreManager.prototype.updateShare = function updateShare(request, callback) { + return this.rpcCall(updateShare, $root.google.cloud.filestore.v1beta1.UpdateShareRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateShare" }); + + /** + * Calls UpdateShare. + * @function updateShare + * @memberof google.cloud.filestore.v1beta1.CloudFilestoreManager + * @instance + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest} request UpdateShareRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + return CloudFilestoreManager; })(); @@ -6869,6 +7232,7 @@ * @property {Array.|null} [modes] NetworkConfig modes * @property {string|null} [reservedIpRange] NetworkConfig reservedIpRange * @property {Array.|null} [ipAddresses] NetworkConfig ipAddresses + * @property {google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode|null} [connectMode] NetworkConfig connectMode */ /** @@ -6920,6 +7284,14 @@ */ NetworkConfig.prototype.ipAddresses = $util.emptyArray; + /** + * NetworkConfig connectMode. + * @member {google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode} connectMode + * @memberof google.cloud.filestore.v1beta1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.connectMode = 0; + /** * Creates a new NetworkConfig instance using the specified properties. * @function create @@ -6957,6 +7329,8 @@ if (message.ipAddresses != null && message.ipAddresses.length) for (var i = 0; i < message.ipAddresses.length; ++i) writer.uint32(/* id 5, wireType 2 =*/42).string(message.ipAddresses[i]); + if (message.connectMode != null && Object.hasOwnProperty.call(message, "connectMode")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.connectMode); return writer; }; @@ -7016,6 +7390,10 @@ message.ipAddresses.push(reader.string()); break; } + case 6: { + message.connectMode = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -7076,6 +7454,15 @@ if (!$util.isString(message.ipAddresses[i])) return "ipAddresses: string[] expected"; } + if (message.connectMode != null && message.hasOwnProperty("connectMode")) + switch (message.connectMode) { + default: + return "connectMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; @@ -7123,6 +7510,26 @@ for (var i = 0; i < object.ipAddresses.length; ++i) message.ipAddresses[i] = String(object.ipAddresses[i]); } + switch (object.connectMode) { + default: + if (typeof object.connectMode === "number") { + message.connectMode = object.connectMode; + break; + } + break; + case "CONNECT_MODE_UNSPECIFIED": + case 0: + message.connectMode = 0; + break; + case "DIRECT_PEERING": + case 1: + message.connectMode = 1; + break; + case "PRIVATE_SERVICE_ACCESS": + case 2: + message.connectMode = 2; + break; + } return message; }; @@ -7146,6 +7553,7 @@ if (options.defaults) { object.network = ""; object.reservedIpRange = ""; + object.connectMode = options.enums === String ? "CONNECT_MODE_UNSPECIFIED" : 0; } if (message.network != null && message.hasOwnProperty("network")) object.network = message.network; @@ -7161,6 +7569,8 @@ for (var j = 0; j < message.ipAddresses.length; ++j) object.ipAddresses[j] = message.ipAddresses[j]; } + if (message.connectMode != null && message.hasOwnProperty("connectMode")) + object.connectMode = options.enums === String ? $root.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode[message.connectMode] === undefined ? message.connectMode : $root.google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode[message.connectMode] : message.connectMode; return object; }; @@ -7204,6 +7614,22 @@ return values; })(); + /** + * ConnectMode enum. + * @name google.cloud.filestore.v1beta1.NetworkConfig.ConnectMode + * @enum {number} + * @property {number} CONNECT_MODE_UNSPECIFIED=0 CONNECT_MODE_UNSPECIFIED value + * @property {number} DIRECT_PEERING=1 DIRECT_PEERING value + * @property {number} PRIVATE_SERVICE_ACCESS=2 PRIVATE_SERVICE_ACCESS value + */ + NetworkConfig.ConnectMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONNECT_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "DIRECT_PEERING"] = 1; + values[valuesById[2] = "PRIVATE_SERVICE_ACCESS"] = 2; + return values; + })(); + return NetworkConfig; })(); @@ -7973,6 +8399,13 @@ * @property {Array.|null} [networks] Instance networks * @property {string|null} [etag] Instance etag * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Instance satisfiesPzs + * @property {string|null} [kmsKeyName] Instance kmsKeyName + * @property {Array.|null} [suspensionReasons] Instance suspensionReasons + * @property {number|Long|null} [maxCapacityGb] Instance maxCapacityGb + * @property {number|Long|null} [capacityStepSizeGb] Instance capacityStepSizeGb + * @property {number|Long|null} [maxShareCount] Instance maxShareCount + * @property {number|Long|null} [capacityGb] Instance capacityGb + * @property {boolean|null} [multiShareEnabled] Instance multiShareEnabled */ /** @@ -7987,6 +8420,7 @@ this.labels = {}; this.fileShares = []; this.networks = []; + this.suspensionReasons = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8082,7 +8516,63 @@ Instance.prototype.satisfiesPzs = null; /** - * Creates a new Instance instance using the specified properties. + * Instance kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.kmsKeyName = ""; + + /** + * Instance suspensionReasons. + * @member {Array.} suspensionReasons + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.suspensionReasons = $util.emptyArray; + + /** + * Instance maxCapacityGb. + * @member {number|Long} maxCapacityGb + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.maxCapacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance capacityStepSizeGb. + * @member {number|Long} capacityStepSizeGb + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.capacityStepSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance maxShareCount. + * @member {number|Long} maxShareCount + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.maxShareCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Instance multiShareEnabled. + * @member {boolean} multiShareEnabled + * @memberof google.cloud.filestore.v1beta1.Instance + * @instance + */ + Instance.prototype.multiShareEnabled = false; + + /** + * Creates a new Instance instance using the specified properties. * @function create * @memberof google.cloud.filestore.v1beta1.Instance * @static @@ -8130,6 +8620,24 @@ writer.uint32(/* id 12, wireType 2 =*/98).string(message.etag); if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.kmsKeyName); + if (message.suspensionReasons != null && message.suspensionReasons.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < message.suspensionReasons.length; ++i) + writer.int32(message.suspensionReasons[i]); + writer.ldelim(); + } + if (message.maxCapacityGb != null && Object.hasOwnProperty.call(message, "maxCapacityGb")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.maxCapacityGb); + if (message.capacityStepSizeGb != null && Object.hasOwnProperty.call(message, "capacityStepSizeGb")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.capacityStepSizeGb); + if (message.maxShareCount != null && Object.hasOwnProperty.call(message, "maxShareCount")) + writer.uint32(/* id 18, wireType 0 =*/144).int64(message.maxShareCount); + if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.capacityGb); + if (message.multiShareEnabled != null && Object.hasOwnProperty.call(message, "multiShareEnabled")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.multiShareEnabled); return writer; }; @@ -8231,6 +8739,41 @@ message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); break; } + case 14: { + message.kmsKeyName = reader.string(); + break; + } + case 15: { + if (!(message.suspensionReasons && message.suspensionReasons.length)) + message.suspensionReasons = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.suspensionReasons.push(reader.int32()); + } else + message.suspensionReasons.push(reader.int32()); + break; + } + case 16: { + message.maxCapacityGb = reader.int64(); + break; + } + case 17: { + message.capacityStepSizeGb = reader.int64(); + break; + } + case 18: { + message.maxShareCount = reader.int64(); + break; + } + case 19: { + message.capacityGb = reader.int64(); + break; + } + case 20: { + message.multiShareEnabled = reader.bool(); + break; + } default: reader.skipType(tag & 7); break; @@ -8283,6 +8826,10 @@ case 4: case 6: case 7: + case 8: + case 9: + case 10: + case 11: break; } if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) @@ -8303,6 +8850,7 @@ case 3: case 4: case 6: + case 7: break; } if (message.labels != null && message.hasOwnProperty("labels")) { @@ -8339,6 +8887,36 @@ if (error) return "satisfiesPzs." + error; } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + if (message.suspensionReasons != null && message.hasOwnProperty("suspensionReasons")) { + if (!Array.isArray(message.suspensionReasons)) + return "suspensionReasons: array expected"; + for (var i = 0; i < message.suspensionReasons.length; ++i) + switch (message.suspensionReasons[i]) { + default: + return "suspensionReasons: enum value[] expected"; + case 0: + case 1: + break; + } + } + if (message.maxCapacityGb != null && message.hasOwnProperty("maxCapacityGb")) + if (!$util.isInteger(message.maxCapacityGb) && !(message.maxCapacityGb && $util.isInteger(message.maxCapacityGb.low) && $util.isInteger(message.maxCapacityGb.high))) + return "maxCapacityGb: integer|Long expected"; + if (message.capacityStepSizeGb != null && message.hasOwnProperty("capacityStepSizeGb")) + if (!$util.isInteger(message.capacityStepSizeGb) && !(message.capacityStepSizeGb && $util.isInteger(message.capacityStepSizeGb.low) && $util.isInteger(message.capacityStepSizeGb.high))) + return "capacityStepSizeGb: integer|Long expected"; + if (message.maxShareCount != null && message.hasOwnProperty("maxShareCount")) + if (!$util.isInteger(message.maxShareCount) && !(message.maxShareCount && $util.isInteger(message.maxShareCount.low) && $util.isInteger(message.maxShareCount.high))) + return "maxShareCount: integer|Long expected"; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.multiShareEnabled != null && message.hasOwnProperty("multiShareEnabled")) + if (typeof message.multiShareEnabled !== "boolean") + return "multiShareEnabled: boolean expected"; return null; }; @@ -8393,6 +8971,22 @@ case 7: message.state = 7; break; + case "SUSPENDED": + case 8: + message.state = 8; + break; + case "REVERTING": + case 9: + message.state = 9; + break; + case "SUSPENDING": + case 10: + message.state = 10; + break; + case "RESUMING": + case 11: + message.state = 11; + break; } if (object.statusMessage != null) message.statusMessage = String(object.statusMessage); @@ -8432,6 +9026,10 @@ case 6: message.tier = 6; break; + case "ENTERPRISE": + case 7: + message.tier = 7; + break; } if (object.labels) { if (typeof object.labels !== "object") @@ -8467,6 +9065,67 @@ throw TypeError(".google.cloud.filestore.v1beta1.Instance.satisfiesPzs: object expected"); message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.suspensionReasons) { + if (!Array.isArray(object.suspensionReasons)) + throw TypeError(".google.cloud.filestore.v1beta1.Instance.suspensionReasons: array expected"); + message.suspensionReasons = []; + for (var i = 0; i < object.suspensionReasons.length; ++i) + switch (object.suspensionReasons[i]) { + default: + if (typeof object.suspensionReasons[i] === "number") { + message.suspensionReasons[i] = object.suspensionReasons[i]; + break; + } + case "SUSPENSION_REASON_UNSPECIFIED": + case 0: + message.suspensionReasons[i] = 0; + break; + case "KMS_KEY_ISSUE": + case 1: + message.suspensionReasons[i] = 1; + break; + } + } + if (object.maxCapacityGb != null) + if ($util.Long) + (message.maxCapacityGb = $util.Long.fromValue(object.maxCapacityGb)).unsigned = false; + else if (typeof object.maxCapacityGb === "string") + message.maxCapacityGb = parseInt(object.maxCapacityGb, 10); + else if (typeof object.maxCapacityGb === "number") + message.maxCapacityGb = object.maxCapacityGb; + else if (typeof object.maxCapacityGb === "object") + message.maxCapacityGb = new $util.LongBits(object.maxCapacityGb.low >>> 0, object.maxCapacityGb.high >>> 0).toNumber(); + if (object.capacityStepSizeGb != null) + if ($util.Long) + (message.capacityStepSizeGb = $util.Long.fromValue(object.capacityStepSizeGb)).unsigned = false; + else if (typeof object.capacityStepSizeGb === "string") + message.capacityStepSizeGb = parseInt(object.capacityStepSizeGb, 10); + else if (typeof object.capacityStepSizeGb === "number") + message.capacityStepSizeGb = object.capacityStepSizeGb; + else if (typeof object.capacityStepSizeGb === "object") + message.capacityStepSizeGb = new $util.LongBits(object.capacityStepSizeGb.low >>> 0, object.capacityStepSizeGb.high >>> 0).toNumber(); + if (object.maxShareCount != null) + if ($util.Long) + (message.maxShareCount = $util.Long.fromValue(object.maxShareCount)).unsigned = false; + else if (typeof object.maxShareCount === "string") + message.maxShareCount = parseInt(object.maxShareCount, 10); + else if (typeof object.maxShareCount === "number") + message.maxShareCount = object.maxShareCount; + else if (typeof object.maxShareCount === "object") + message.maxShareCount = new $util.LongBits(object.maxShareCount.low >>> 0, object.maxShareCount.high >>> 0).toNumber(); + if (object.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.multiShareEnabled != null) + message.multiShareEnabled = Boolean(object.multiShareEnabled); return message; }; @@ -8486,6 +9145,7 @@ if (options.arrays || options.defaults) { object.fileShares = []; object.networks = []; + object.suspensionReasons = []; } if (options.objects || options.defaults) object.labels = {}; @@ -8498,6 +9158,28 @@ object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; object.etag = ""; object.satisfiesPzs = null; + object.kmsKeyName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxCapacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxCapacityGb = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityStepSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityStepSizeGb = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.maxShareCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.maxShareCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + object.multiShareEnabled = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; @@ -8531,6 +9213,35 @@ object.etag = message.etag; if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + if (message.suspensionReasons && message.suspensionReasons.length) { + object.suspensionReasons = []; + for (var j = 0; j < message.suspensionReasons.length; ++j) + object.suspensionReasons[j] = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.SuspensionReason[message.suspensionReasons[j]] === undefined ? message.suspensionReasons[j] : $root.google.cloud.filestore.v1beta1.Instance.SuspensionReason[message.suspensionReasons[j]] : message.suspensionReasons[j]; + } + if (message.maxCapacityGb != null && message.hasOwnProperty("maxCapacityGb")) + if (typeof message.maxCapacityGb === "number") + object.maxCapacityGb = options.longs === String ? String(message.maxCapacityGb) : message.maxCapacityGb; + else + object.maxCapacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.maxCapacityGb) : options.longs === Number ? new $util.LongBits(message.maxCapacityGb.low >>> 0, message.maxCapacityGb.high >>> 0).toNumber() : message.maxCapacityGb; + if (message.capacityStepSizeGb != null && message.hasOwnProperty("capacityStepSizeGb")) + if (typeof message.capacityStepSizeGb === "number") + object.capacityStepSizeGb = options.longs === String ? String(message.capacityStepSizeGb) : message.capacityStepSizeGb; + else + object.capacityStepSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityStepSizeGb) : options.longs === Number ? new $util.LongBits(message.capacityStepSizeGb.low >>> 0, message.capacityStepSizeGb.high >>> 0).toNumber() : message.capacityStepSizeGb; + if (message.maxShareCount != null && message.hasOwnProperty("maxShareCount")) + if (typeof message.maxShareCount === "number") + object.maxShareCount = options.longs === String ? String(message.maxShareCount) : message.maxShareCount; + else + object.maxShareCount = options.longs === String ? $util.Long.prototype.toString.call(message.maxShareCount) : options.longs === Number ? new $util.LongBits(message.maxShareCount.low >>> 0, message.maxShareCount.high >>> 0).toNumber() : message.maxShareCount; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.multiShareEnabled != null && message.hasOwnProperty("multiShareEnabled")) + object.multiShareEnabled = message.multiShareEnabled; return object; }; @@ -8571,6 +9282,10 @@ * @property {number} DELETING=4 DELETING value * @property {number} ERROR=6 ERROR value * @property {number} RESTORING=7 RESTORING value + * @property {number} SUSPENDED=8 SUSPENDED value + * @property {number} REVERTING=9 REVERTING value + * @property {number} SUSPENDING=10 SUSPENDING value + * @property {number} RESUMING=11 RESUMING value */ Instance.State = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8581,6 +9296,10 @@ values[valuesById[4] = "DELETING"] = 4; values[valuesById[6] = "ERROR"] = 6; values[valuesById[7] = "RESTORING"] = 7; + values[valuesById[8] = "SUSPENDED"] = 8; + values[valuesById[9] = "REVERTING"] = 9; + values[valuesById[10] = "SUSPENDING"] = 10; + values[valuesById[11] = "RESUMING"] = 11; return values; })(); @@ -8594,6 +9313,7 @@ * @property {number} BASIC_HDD=3 BASIC_HDD value * @property {number} BASIC_SSD=4 BASIC_SSD value * @property {number} HIGH_SCALE_SSD=6 HIGH_SCALE_SSD value + * @property {number} ENTERPRISE=7 ENTERPRISE value */ Instance.Tier = (function() { var valuesById = {}, values = Object.create(valuesById); @@ -8603,6 +9323,21 @@ values[valuesById[3] = "BASIC_HDD"] = 3; values[valuesById[4] = "BASIC_SSD"] = 4; values[valuesById[6] = "HIGH_SCALE_SSD"] = 6; + values[valuesById[7] = "ENTERPRISE"] = 7; + return values; + })(); + + /** + * SuspensionReason enum. + * @name google.cloud.filestore.v1beta1.Instance.SuspensionReason + * @enum {number} + * @property {number} SUSPENSION_REASON_UNSPECIFIED=0 SUSPENSION_REASON_UNSPECIFIED value + * @property {number} KMS_KEY_ISSUE=1 KMS_KEY_ISSUE value + */ + Instance.SuspensionReason = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SUSPENSION_REASON_UNSPECIFIED"] = 0; + values[valuesById[1] = "KMS_KEY_ISSUE"] = 1; return values; })(); @@ -9602,24 +10337,25 @@ return RestoreInstanceRequest; })(); - v1beta1.DeleteInstanceRequest = (function() { + v1beta1.RevertInstanceRequest = (function() { /** - * Properties of a DeleteInstanceRequest. + * Properties of a RevertInstanceRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IDeleteInstanceRequest - * @property {string|null} [name] DeleteInstanceRequest name + * @interface IRevertInstanceRequest + * @property {string|null} [name] RevertInstanceRequest name + * @property {string|null} [targetSnapshotId] RevertInstanceRequest targetSnapshotId */ /** - * Constructs a new DeleteInstanceRequest. + * Constructs a new RevertInstanceRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a DeleteInstanceRequest. - * @implements IDeleteInstanceRequest + * @classdesc Represents a RevertInstanceRequest. + * @implements IRevertInstanceRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest=} [properties] Properties to set */ - function DeleteInstanceRequest(properties) { + function RevertInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9627,70 +10363,80 @@ } /** - * DeleteInstanceRequest name. + * RevertInstanceRequest name. * @member {string} name - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @instance */ - DeleteInstanceRequest.prototype.name = ""; + RevertInstanceRequest.prototype.name = ""; /** - * Creates a new DeleteInstanceRequest instance using the specified properties. + * RevertInstanceRequest targetSnapshotId. + * @member {string} targetSnapshotId + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest + * @instance + */ + RevertInstanceRequest.prototype.targetSnapshotId = ""; + + /** + * Creates a new RevertInstanceRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest instance + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.RevertInstanceRequest} RevertInstanceRequest instance */ - DeleteInstanceRequest.create = function create(properties) { - return new DeleteInstanceRequest(properties); + RevertInstanceRequest.create = function create(properties) { + return new RevertInstanceRequest(properties); }; /** - * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified RevertInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.RevertInstanceRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest} message RevertInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encode = function encode(message, writer) { + RevertInstanceRequest.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.targetSnapshotId != null && Object.hasOwnProperty.call(message, "targetSnapshotId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.targetSnapshotId); return writer; }; /** - * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * Encodes the specified RevertInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.RevertInstanceRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IRevertInstanceRequest} message RevertInstanceRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { + RevertInstanceRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer. + * Decodes a RevertInstanceRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.filestore.v1beta1.RevertInstanceRequest} RevertInstanceRequest * @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) { + RevertInstanceRequest.decode = function 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.filestore.v1beta1.DeleteInstanceRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.RevertInstanceRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9698,6 +10444,10 @@ message.name = reader.string(); break; } + case 2: { + message.targetSnapshotId = reader.string(); + break; + } default: reader.skipType(tag & 7); break; @@ -9707,126 +10457,132 @@ }; /** - * Decodes a DeleteInstanceRequest message from the specified reader or buffer, length delimited. + * Decodes a RevertInstanceRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.filestore.v1beta1.RevertInstanceRequest} RevertInstanceRequest * @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) { + RevertInstanceRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteInstanceRequest message. + * Verifies a RevertInstanceRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @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) { + RevertInstanceRequest.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.targetSnapshotId != null && message.hasOwnProperty("targetSnapshotId")) + if (!$util.isString(message.targetSnapshotId)) + return "targetSnapshotId: string expected"; return null; }; /** - * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * Creates a RevertInstanceRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + * @returns {google.cloud.filestore.v1beta1.RevertInstanceRequest} RevertInstanceRequest */ - DeleteInstanceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest) + RevertInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.RevertInstanceRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest(); + var message = new $root.google.cloud.filestore.v1beta1.RevertInstanceRequest(); if (object.name != null) message.name = String(object.name); + if (object.targetSnapshotId != null) + message.targetSnapshotId = String(object.targetSnapshotId); return message; }; /** - * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * Creates a plain object from a RevertInstanceRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static - * @param {google.cloud.filestore.v1beta1.DeleteInstanceRequest} message DeleteInstanceRequest + * @param {google.cloud.filestore.v1beta1.RevertInstanceRequest} message RevertInstanceRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteInstanceRequest.toObject = function toObject(message, options) { + RevertInstanceRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.targetSnapshotId = ""; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.targetSnapshotId != null && message.hasOwnProperty("targetSnapshotId")) + object.targetSnapshotId = message.targetSnapshotId; return object; }; /** - * Converts this DeleteInstanceRequest to JSON. + * Converts this RevertInstanceRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @instance * @returns {Object.} JSON object */ - DeleteInstanceRequest.prototype.toJSON = function toJSON() { + RevertInstanceRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteInstanceRequest + * Gets the default type url for RevertInstanceRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @memberof google.cloud.filestore.v1beta1.RevertInstanceRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + RevertInstanceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteInstanceRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.RevertInstanceRequest"; }; - return DeleteInstanceRequest; + return RevertInstanceRequest; })(); - v1beta1.ListInstancesRequest = (function() { + v1beta1.DeleteInstanceRequest = (function() { /** - * Properties of a ListInstancesRequest. + * Properties of a DeleteInstanceRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IListInstancesRequest - * @property {string|null} [parent] ListInstancesRequest parent - * @property {number|null} [pageSize] ListInstancesRequest pageSize - * @property {string|null} [pageToken] ListInstancesRequest pageToken - * @property {string|null} [orderBy] ListInstancesRequest orderBy - * @property {string|null} [filter] ListInstancesRequest filter + * @interface IDeleteInstanceRequest + * @property {string|null} [name] DeleteInstanceRequest name + * @property {boolean|null} [force] DeleteInstanceRequest force */ /** - * Constructs a new ListInstancesRequest. + * Constructs a new DeleteInstanceRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a ListInstancesRequest. - * @implements IListInstancesRequest + * @classdesc Represents a DeleteInstanceRequest. + * @implements IDeleteInstanceRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IListInstancesRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set */ - function ListInstancesRequest(properties) { + function DeleteInstanceRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9834,40 +10590,270 @@ } /** - * ListInstancesRequest parent. - * @member {string} parent - * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * DeleteInstanceRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest * @instance */ - ListInstancesRequest.prototype.parent = ""; + DeleteInstanceRequest.prototype.name = ""; /** - * ListInstancesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * DeleteInstanceRequest force. + * @member {boolean} force + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest * @instance */ - ListInstancesRequest.prototype.pageSize = 0; + DeleteInstanceRequest.prototype.force = false; /** - * ListInstancesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest - * @instance + * Creates a new DeleteInstanceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest instance */ - ListInstancesRequest.prototype.pageToken = ""; + DeleteInstanceRequest.create = function create(properties) { + return new DeleteInstanceRequest(properties); + }; /** - * ListInstancesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest - * @instance + * Encodes the specified DeleteInstanceRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteInstanceRequest} message DeleteInstanceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - ListInstancesRequest.prototype.orderBy = ""; - - /** - * ListInstancesRequest filter. - * @member {string} filter + 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); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteInstanceRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteInstanceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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.filestore.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.filestore.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.filestore.v1beta1.DeleteInstanceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.force = reader.bool(); + 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.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.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.filestore.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"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteInstanceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.DeleteInstanceRequest} DeleteInstanceRequest + */ + DeleteInstanceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.DeleteInstanceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteInstanceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @static + * @param {google.cloud.filestore.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 = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteInstanceRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.DeleteInstanceRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteInstanceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteInstanceRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.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.filestore.v1beta1.DeleteInstanceRequest"; + }; + + return DeleteInstanceRequest; + })(); + + v1beta1.ListInstancesRequest = (function() { + + /** + * Properties of a ListInstancesRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListInstancesRequest + * @property {string|null} [parent] ListInstancesRequest parent + * @property {number|null} [pageSize] ListInstancesRequest pageSize + * @property {string|null} [pageToken] ListInstancesRequest pageToken + * @property {string|null} [orderBy] ListInstancesRequest orderBy + * @property {string|null} [filter] ListInstancesRequest filter + */ + + /** + * Constructs a new ListInstancesRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListInstancesRequest. + * @implements IListInstancesRequest + * @constructor + * @param {google.cloud.filestore.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.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.parent = ""; + + /** + * ListInstancesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageSize = 0; + + /** + * ListInstancesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.pageToken = ""; + + /** + * ListInstancesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest + * @instance + */ + ListInstancesRequest.prototype.orderBy = ""; + + /** + * ListInstancesRequest filter. + * @member {string} filter * @memberof google.cloud.filestore.v1beta1.ListInstancesRequest * @instance */ @@ -10810,36 +11796,26 @@ return Snapshot; })(); - v1beta1.Backup = (function() { + v1beta1.CreateSnapshotRequest = (function() { /** - * Properties of a Backup. + * Properties of a CreateSnapshotRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [description] Backup description - * @property {google.cloud.filestore.v1beta1.Backup.State|null} [state] Backup state - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {Object.|null} [labels] Backup labels - * @property {number|Long|null} [capacityGb] Backup capacityGb - * @property {number|Long|null} [storageBytes] Backup storageBytes - * @property {string|null} [sourceInstance] Backup sourceInstance - * @property {string|null} [sourceFileShare] Backup sourceFileShare - * @property {google.cloud.filestore.v1beta1.Instance.Tier|null} [sourceInstanceTier] Backup sourceInstanceTier - * @property {number|Long|null} [downloadBytes] Backup downloadBytes - * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Backup satisfiesPzs + * @interface ICreateSnapshotRequest + * @property {string|null} [parent] CreateSnapshotRequest parent + * @property {string|null} [snapshotId] CreateSnapshotRequest snapshotId + * @property {google.cloud.filestore.v1beta1.ISnapshot|null} [snapshot] CreateSnapshotRequest snapshot */ /** - * Constructs a new Backup. + * Constructs a new CreateSnapshotRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a Backup. - * @implements IBackup + * @classdesc Represents a CreateSnapshotRequest. + * @implements ICreateSnapshotRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest=} [properties] Properties to set */ - function Backup(properties) { - this.labels = {}; + function CreateSnapshotRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10847,181 +11823,3739 @@ } /** - * Backup name. - * @member {string} name - * @memberof google.cloud.filestore.v1beta1.Backup + * CreateSnapshotRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest * @instance */ - Backup.prototype.name = ""; + CreateSnapshotRequest.prototype.parent = ""; /** - * Backup description. - * @member {string} description - * @memberof google.cloud.filestore.v1beta1.Backup + * CreateSnapshotRequest snapshotId. + * @member {string} snapshotId + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest * @instance */ - Backup.prototype.description = ""; + CreateSnapshotRequest.prototype.snapshotId = ""; /** - * Backup state. - * @member {google.cloud.filestore.v1beta1.Backup.State} state - * @memberof google.cloud.filestore.v1beta1.Backup + * CreateSnapshotRequest snapshot. + * @member {google.cloud.filestore.v1beta1.ISnapshot|null|undefined} snapshot + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest * @instance */ - Backup.prototype.state = 0; + CreateSnapshotRequest.prototype.snapshot = null; /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.filestore.v1beta1.Backup - * @instance - */ + * Creates a new CreateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.CreateSnapshotRequest} CreateSnapshotRequest instance + */ + CreateSnapshotRequest.create = function create(properties) { + return new CreateSnapshotRequest(properties); + }; + + /** + * Encodes the specified CreateSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.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.snapshotId != null && Object.hasOwnProperty.call(message, "snapshotId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.snapshotId); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.cloud.filestore.v1beta1.Snapshot.encode(message.snapshot, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateSnapshotRequest} message CreateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.decode = function 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.filestore.v1beta1.CreateSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.snapshotId = reader.string(); + break; + } + case 3: { + message.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.CreateSnapshotRequest} CreateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateSnapshotRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSnapshotRequest.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.snapshotId != null && message.hasOwnProperty("snapshotId")) + if (!$util.isString(message.snapshotId)) + return "snapshotId: string expected"; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.cloud.filestore.v1beta1.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + return null; + }; + + /** + * Creates a CreateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.CreateSnapshotRequest} CreateSnapshotRequest + */ + CreateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.CreateSnapshotRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.CreateSnapshotRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.snapshotId != null) + message.snapshotId = String(object.snapshotId); + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.CreateSnapshotRequest.snapshot: object expected"); + message.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.fromObject(object.snapshot); + } + return message; + }; + + /** + * Creates a plain object from a CreateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.CreateSnapshotRequest} message CreateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.snapshotId = ""; + object.snapshot = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.snapshotId != null && message.hasOwnProperty("snapshotId")) + object.snapshotId = message.snapshotId; + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.toObject(message.snapshot, options); + return object; + }; + + /** + * Converts this CreateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.CreateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.CreateSnapshotRequest"; + }; + + return CreateSnapshotRequest; + })(); + + v1beta1.GetSnapshotRequest = (function() { + + /** + * Properties of a GetSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IGetSnapshotRequest + * @property {string|null} [name] GetSnapshotRequest name + */ + + /** + * Constructs a new GetSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a GetSnapshotRequest. + * @implements IGetSnapshotRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest=} [properties] Properties to set + */ + function GetSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetSnapshotRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @instance + */ + GetSnapshotRequest.prototype.name = ""; + + /** + * Creates a new GetSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.GetSnapshotRequest} GetSnapshotRequest instance + */ + GetSnapshotRequest.create = function create(properties) { + return new GetSnapshotRequest(properties); + }; + + /** + * Encodes the specified GetSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetSnapshotRequest} message GetSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.GetSnapshotRequest(); + 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 GetSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.GetSnapshotRequest} GetSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetSnapshotRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.GetSnapshotRequest} GetSnapshotRequest + */ + GetSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.GetSnapshotRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.GetSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.GetSnapshotRequest} message GetSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + GetSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.GetSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.GetSnapshotRequest"; + }; + + return GetSnapshotRequest; + })(); + + v1beta1.DeleteSnapshotRequest = (function() { + + /** + * Properties of a DeleteSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IDeleteSnapshotRequest + * @property {string|null} [name] DeleteSnapshotRequest name + */ + + /** + * Constructs a new DeleteSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a DeleteSnapshotRequest. + * @implements IDeleteSnapshotRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest=} [properties] Properties to set + */ + function DeleteSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteSnapshotRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @instance + */ + DeleteSnapshotRequest.prototype.name = ""; + + /** + * Creates a new DeleteSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteSnapshotRequest} DeleteSnapshotRequest instance + */ + DeleteSnapshotRequest.create = function create(properties) { + return new DeleteSnapshotRequest(properties); + }; + + /** + * Encodes the specified DeleteSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteSnapshotRequest} message DeleteSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.DeleteSnapshotRequest(); + 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 DeleteSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.DeleteSnapshotRequest} DeleteSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteSnapshotRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.DeleteSnapshotRequest} DeleteSnapshotRequest + */ + DeleteSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteSnapshotRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.DeleteSnapshotRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.DeleteSnapshotRequest} message DeleteSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.DeleteSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteSnapshotRequest"; + }; + + return DeleteSnapshotRequest; + })(); + + v1beta1.UpdateSnapshotRequest = (function() { + + /** + * Properties of an UpdateSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IUpdateSnapshotRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSnapshotRequest updateMask + * @property {google.cloud.filestore.v1beta1.ISnapshot|null} [snapshot] UpdateSnapshotRequest snapshot + */ + + /** + * Constructs a new UpdateSnapshotRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents an UpdateSnapshotRequest. + * @implements IUpdateSnapshotRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest=} [properties] Properties to set + */ + function UpdateSnapshotRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateSnapshotRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.updateMask = null; + + /** + * UpdateSnapshotRequest snapshot. + * @member {google.cloud.filestore.v1beta1.ISnapshot|null|undefined} snapshot + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @instance + */ + UpdateSnapshotRequest.prototype.snapshot = null; + + /** + * Creates a new UpdateSnapshotRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.UpdateSnapshotRequest} UpdateSnapshotRequest instance + */ + UpdateSnapshotRequest.create = function create(properties) { + return new UpdateSnapshotRequest(properties); + }; + + /** + * Encodes the specified UpdateSnapshotRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateSnapshotRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.snapshot != null && Object.hasOwnProperty.call(message, "snapshot")) + $root.google.cloud.filestore.v1beta1.Snapshot.encode(message.snapshot, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateSnapshotRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateSnapshotRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateSnapshotRequest} message UpdateSnapshotRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSnapshotRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.decode = function 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.filestore.v1beta1.UpdateSnapshotRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateSnapshotRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.UpdateSnapshotRequest} UpdateSnapshotRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSnapshotRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateSnapshotRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSnapshotRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.snapshot != null && message.hasOwnProperty("snapshot")) { + var error = $root.google.cloud.filestore.v1beta1.Snapshot.verify(message.snapshot); + if (error) + return "snapshot." + error; + } + return null; + }; + + /** + * Creates an UpdateSnapshotRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.UpdateSnapshotRequest} UpdateSnapshotRequest + */ + UpdateSnapshotRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateSnapshotRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.UpdateSnapshotRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateSnapshotRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.snapshot != null) { + if (typeof object.snapshot !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateSnapshotRequest.snapshot: object expected"); + message.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.fromObject(object.snapshot); + } + return message; + }; + + /** + * Creates a plain object from an UpdateSnapshotRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {google.cloud.filestore.v1beta1.UpdateSnapshotRequest} message UpdateSnapshotRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSnapshotRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.snapshot = null; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.snapshot != null && message.hasOwnProperty("snapshot")) + object.snapshot = $root.google.cloud.filestore.v1beta1.Snapshot.toObject(message.snapshot, options); + return object; + }; + + /** + * Converts this UpdateSnapshotRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSnapshotRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateSnapshotRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.UpdateSnapshotRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateSnapshotRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.UpdateSnapshotRequest"; + }; + + return UpdateSnapshotRequest; + })(); + + v1beta1.ListSnapshotsRequest = (function() { + + /** + * Properties of a ListSnapshotsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListSnapshotsRequest + * @property {string|null} [parent] ListSnapshotsRequest parent + * @property {number|null} [pageSize] ListSnapshotsRequest pageSize + * @property {string|null} [pageToken] ListSnapshotsRequest pageToken + * @property {string|null} [orderBy] ListSnapshotsRequest orderBy + * @property {string|null} [filter] ListSnapshotsRequest filter + */ + + /** + * Constructs a new ListSnapshotsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListSnapshotsRequest. + * @implements IListSnapshotsRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest=} [properties] Properties to set + */ + function ListSnapshotsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.parent = ""; + + /** + * ListSnapshotsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageSize = 0; + + /** + * ListSnapshotsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.pageToken = ""; + + /** + * ListSnapshotsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.orderBy = ""; + + /** + * ListSnapshotsRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + */ + ListSnapshotsRequest.prototype.filter = ""; + + /** + * Creates a new ListSnapshotsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsRequest} ListSnapshotsRequest instance + */ + ListSnapshotsRequest.create = function create(properties) { + return new ListSnapshotsRequest(properties); + }; + + /** + * Encodes the specified ListSnapshotsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSnapshotsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsRequest} message ListSnapshotsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.ListSnapshotsRequest(); + 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsRequest} ListSnapshotsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsRequest} ListSnapshotsRequest + */ + ListSnapshotsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListSnapshotsRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListSnapshotsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {google.cloud.filestore.v1beta1.ListSnapshotsRequest} message ListSnapshotsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSnapshotsRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListSnapshotsRequest"; + }; + + return ListSnapshotsRequest; + })(); + + v1beta1.ListSnapshotsResponse = (function() { + + /** + * Properties of a ListSnapshotsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListSnapshotsResponse + * @property {Array.|null} [snapshots] ListSnapshotsResponse snapshots + * @property {string|null} [nextPageToken] ListSnapshotsResponse nextPageToken + */ + + /** + * Constructs a new ListSnapshotsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListSnapshotsResponse. + * @implements IListSnapshotsResponse + * @constructor + * @param {google.cloud.filestore.v1beta1.IListSnapshotsResponse=} [properties] Properties to set + */ + function ListSnapshotsResponse(properties) { + this.snapshots = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSnapshotsResponse snapshots. + * @member {Array.} snapshots + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.snapshots = $util.emptyArray; + + /** + * ListSnapshotsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @instance + */ + ListSnapshotsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSnapshotsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsResponse} ListSnapshotsResponse instance + */ + ListSnapshotsResponse.create = function create(properties) { + return new ListSnapshotsResponse(properties); + }; + + /** + * Encodes the specified ListSnapshotsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.snapshots != null && message.snapshots.length) + for (var i = 0; i < message.snapshots.length; ++i) + $root.google.cloud.filestore.v1beta1.Snapshot.encode(message.snapshots[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 ListSnapshotsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSnapshotsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListSnapshotsResponse} message ListSnapshotsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSnapshotsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.ListSnapshotsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.snapshots && message.snapshots.length)) + message.snapshots = []; + message.snapshots.push($root.google.cloud.filestore.v1beta1.Snapshot.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSnapshotsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsResponse} ListSnapshotsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSnapshotsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSnapshotsResponse message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSnapshotsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.snapshots != null && message.hasOwnProperty("snapshots")) { + if (!Array.isArray(message.snapshots)) + return "snapshots: array expected"; + for (var i = 0; i < message.snapshots.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.Snapshot.verify(message.snapshots[i]); + if (error) + return "snapshots." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSnapshotsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListSnapshotsResponse} ListSnapshotsResponse + */ + ListSnapshotsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListSnapshotsResponse) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListSnapshotsResponse(); + if (object.snapshots) { + if (!Array.isArray(object.snapshots)) + throw TypeError(".google.cloud.filestore.v1beta1.ListSnapshotsResponse.snapshots: array expected"); + message.snapshots = []; + for (var i = 0; i < object.snapshots.length; ++i) { + if (typeof object.snapshots[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.ListSnapshotsResponse.snapshots: object expected"); + message.snapshots[i] = $root.google.cloud.filestore.v1beta1.Snapshot.fromObject(object.snapshots[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSnapshotsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {google.cloud.filestore.v1beta1.ListSnapshotsResponse} message ListSnapshotsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSnapshotsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snapshots = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.snapshots && message.snapshots.length) { + object.snapshots = []; + for (var j = 0; j < message.snapshots.length; ++j) + object.snapshots[j] = $root.google.cloud.filestore.v1beta1.Snapshot.toObject(message.snapshots[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSnapshotsResponse to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSnapshotsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListSnapshotsResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListSnapshotsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListSnapshotsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListSnapshotsResponse"; + }; + + return ListSnapshotsResponse; + })(); + + v1beta1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.filestore.v1beta1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.cloud.filestore.v1beta1.Backup.State|null} [state] Backup state + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {Object.|null} [labels] Backup labels + * @property {number|Long|null} [capacityGb] Backup capacityGb + * @property {number|Long|null} [storageBytes] Backup storageBytes + * @property {string|null} [sourceInstance] Backup sourceInstance + * @property {string|null} [sourceFileShare] Backup sourceFileShare + * @property {google.cloud.filestore.v1beta1.Instance.Tier|null} [sourceInstanceTier] Backup sourceInstanceTier + * @property {number|Long|null} [downloadBytes] Backup downloadBytes + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] Backup satisfiesPzs + * @property {string|null} [kmsKeyName] Backup kmsKeyName + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string} description + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.description = ""; + + /** + * Backup state. + * @member {google.cloud.filestore.v1beta1.Backup.State} state + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ Backup.prototype.createTime = null; /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.filestore.v1beta1.Backup + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup storageBytes. + * @member {number|Long} storageBytes + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.storageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup sourceInstance. + * @member {string} sourceInstance + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceInstance = ""; + + /** + * Backup sourceFileShare. + * @member {string} sourceFileShare + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceFileShare = ""; + + /** + * Backup sourceInstanceTier. + * @member {google.cloud.filestore.v1beta1.Instance.Tier} sourceInstanceTier + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.sourceInstanceTier = 0; + + /** + * Backup downloadBytes. + * @member {number|Long} downloadBytes + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.downloadBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = null; + + /** + * Backup kmsKeyName. + * @member {string} kmsKeyName + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + */ + Backup.prototype.kmsKeyName = ""; + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.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.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacityGb); + if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.storageBytes); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceInstance); + if (message.sourceFileShare != null && Object.hasOwnProperty.call(message, "sourceFileShare")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceFileShare); + if (message.sourceInstanceTier != null && Object.hasOwnProperty.call(message, "sourceInstanceTier")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sourceInstanceTier); + if (message.downloadBytes != null && Object.hasOwnProperty.call(message, "downloadBytes")) + writer.uint32(/* id 11, wireType 0 =*/88).int64(message.downloadBytes); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function 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.filestore.v1beta1.Backup(), 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.state = reader.int32(); + break; + } + case 4: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.capacityGb = reader.int64(); + break; + } + case 7: { + message.storageBytes = reader.int64(); + break; + } + case 8: { + message.sourceInstance = reader.string(); + break; + } + case 9: { + message.sourceFileShare = reader.string(); + break; + } + case 10: { + message.sourceInstanceTier = reader.int32(); + break; + } + case 11: { + message.downloadBytes = reader.int64(); + break; + } + case 12: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 13: { + message.kmsKeyName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) + return "storageBytes: integer|Long expected"; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + if (!$util.isString(message.sourceFileShare)) + return "sourceFileShare: string expected"; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + switch (message.sourceInstanceTier) { + default: + return "sourceInstanceTier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 6: + case 7: + break; + } + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (!$util.isInteger(message.downloadBytes) && !(message.downloadBytes && $util.isInteger(message.downloadBytes.low) && $util.isInteger(message.downloadBytes.high))) + return "downloadBytes: integer|Long expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.Backup) + return object; + var message = new $root.google.cloud.filestore.v1beta1.Backup(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "FINALIZING": + case 2: + message.state = 2; + break; + case "READY": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.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.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.storageBytes != null) + if ($util.Long) + (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; + else if (typeof object.storageBytes === "string") + message.storageBytes = parseInt(object.storageBytes, 10); + else if (typeof object.storageBytes === "number") + message.storageBytes = object.storageBytes; + else if (typeof object.storageBytes === "object") + message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.sourceFileShare != null) + message.sourceFileShare = String(object.sourceFileShare); + switch (object.sourceInstanceTier) { + default: + if (typeof object.sourceInstanceTier === "number") { + message.sourceInstanceTier = object.sourceInstanceTier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.sourceInstanceTier = 0; + break; + case "STANDARD": + case 1: + message.sourceInstanceTier = 1; + break; + case "PREMIUM": + case 2: + message.sourceInstanceTier = 2; + break; + case "BASIC_HDD": + case 3: + message.sourceInstanceTier = 3; + break; + case "BASIC_SSD": + case 4: + message.sourceInstanceTier = 4; + break; + case "HIGH_SCALE_SSD": + case 6: + message.sourceInstanceTier = 6; + break; + case "ENTERPRISE": + case 7: + message.sourceInstanceTier = 7; + break; + } + if (object.downloadBytes != null) + if ($util.Long) + (message.downloadBytes = $util.Long.fromValue(object.downloadBytes)).unsigned = false; + else if (typeof object.downloadBytes === "string") + message.downloadBytes = parseInt(object.downloadBytes, 10); + else if (typeof object.downloadBytes === "number") + message.downloadBytes = object.downloadBytes; + else if (typeof object.downloadBytes === "object") + message.downloadBytes = new $util.LongBits(object.downloadBytes.low >>> 0, object.downloadBytes.high >>> 0).toNumber(); + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Backup.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {google.cloud.filestore.v1beta1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.capacityGb = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.storageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.storageBytes = options.longs === String ? "0" : 0; + object.sourceInstance = ""; + object.sourceFileShare = ""; + object.sourceInstanceTier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.downloadBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.downloadBytes = options.longs === String ? "0" : 0; + object.satisfiesPzs = null; + object.kmsKeyName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Backup.State[message.state] : message.state; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, 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.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) + if (typeof message.storageBytes === "number") + object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; + else + object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + object.sourceInstance = message.sourceInstance; + if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) + object.sourceFileShare = message.sourceFileShare; + if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) + object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] === undefined ? message.sourceInstanceTier : $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; + if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) + if (typeof message.downloadBytes === "number") + object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; + else + object.downloadBytes = options.longs === String ? $util.Long.prototype.toString.call(message.downloadBytes) : options.longs === Number ? new $util.LongBits(message.downloadBytes.low >>> 0, message.downloadBytes.high >>> 0).toNumber() : message.downloadBytes; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) + object.kmsKeyName = message.kmsKeyName; + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.Backup"; + }; + + /** + * State enum. + * @name google.cloud.filestore.v1beta1.Backup.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} FINALIZING=2 FINALIZING value + * @property {number} READY=3 READY value + * @property {number} DELETING=4 DELETING value + */ + Backup.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "FINALIZING"] = 2; + values[valuesById[3] = "READY"] = 3; + values[valuesById[4] = "DELETING"] = 4; + return values; + })(); + + return Backup; + })(); + + v1beta1.CreateBackupRequest = (function() { + + /** + * Properties of a CreateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface ICreateBackupRequest + * @property {string|null} [parent] CreateBackupRequest parent + * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] CreateBackupRequest backup + * @property {string|null} [backupId] CreateBackupRequest backupId + */ + + /** + * Constructs a new CreateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a CreateBackupRequest. + * @implements ICreateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set + */ + function CreateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.parent = ""; + + /** + * CreateBackupRequest backup. + * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backup = null; + + /** + * CreateBackupRequest backupId. + * @member {string} backupId + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + */ + CreateBackupRequest.prototype.backupId = ""; + + /** + * Creates a new CreateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest instance + */ + CreateBackupRequest.create = function create(properties) { + return new CreateBackupRequest(properties); + }; + + /** + * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.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.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + return writer; + }; + + /** + * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decode = function 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.filestore.v1beta1.CreateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.parent = reader.string(); + break; + } + case 2: { + message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupRequest.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.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.backupId != null && message.hasOwnProperty("backupId")) + if (!$util.isString(message.backupId)) + return "backupId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + */ + CreateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.CreateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.CreateBackupRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.CreateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); + } + if (object.backupId != null) + message.backupId = String(object.backupId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.CreateBackupRequest} message CreateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backup = null; + object.backupId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); + if (message.backupId != null && message.hasOwnProperty("backupId")) + object.backupId = message.backupId; + return object; + }; + + /** + * Converts this CreateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.CreateBackupRequest"; + }; + + return CreateBackupRequest; + })(); + + v1beta1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.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 DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function 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.filestore.v1beta1.DeleteBackupRequest(); + 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 DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.DeleteBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1beta1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IUpdateBackupRequest + * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, 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 UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function 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.filestore.v1beta1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.backup = $root.google.cloud.filestore.v1beta1.Backup.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 UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); + if (error) + return "backup." + 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 UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.UpdateBackupRequest(); + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backup = null; + object.updateMask = null; + } + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1beta1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.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 GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function 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.filestore.v1beta1.GetBackupRequest(); + 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 GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.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 GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.GetBackupRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {google.cloud.filestore.v1beta1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.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 GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1beta1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {string|null} [filter] ListBackupsRequest filter + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function 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.filestore.v1beta1.ListBackupsRequest(); + 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.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListBackupsRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {google.cloud.filestore.v1beta1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1beta1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + 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]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.filestore.v1beta1.Backup.encode(message.backups[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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function 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.filestore.v1beta1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.filestore.v1beta1.Backup.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 ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backups[i]); + if (error) + return "backups." + 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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.filestore.v1beta1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.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 ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {google.cloud.filestore.v1beta1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backups[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 ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse * @instance + * @returns {Object.} JSON object */ - Backup.prototype.labels = $util.emptyObject; + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; /** - * Backup capacityGb. - * @member {number|Long} capacityGb - * @memberof google.cloud.filestore.v1beta1.Backup + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1beta1.Share = (function() { + + /** + * Properties of a Share. + * @memberof google.cloud.filestore.v1beta1 + * @interface IShare + * @property {string|null} [name] Share name + * @property {string|null} [mountName] Share mountName + * @property {string|null} [description] Share description + * @property {number|Long|null} [capacityGb] Share capacityGb + * @property {Array.|null} [nfsExportOptions] Share nfsExportOptions + * @property {google.cloud.filestore.v1beta1.Share.State|null} [state] Share state + * @property {google.protobuf.ITimestamp|null} [createTime] Share createTime + * @property {Object.|null} [labels] Share labels + */ + + /** + * Constructs a new Share. + * @memberof google.cloud.filestore.v1beta1 + * @classdesc Represents a Share. + * @implements IShare + * @constructor + * @param {google.cloud.filestore.v1beta1.IShare=} [properties] Properties to set + */ + function Share(properties) { + this.nfsExportOptions = []; + this.labels = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Share name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Share.prototype.name = ""; /** - * Backup storageBytes. - * @member {number|Long} storageBytes - * @memberof google.cloud.filestore.v1beta1.Backup + * Share mountName. + * @member {string} mountName + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.storageBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Share.prototype.mountName = ""; /** - * Backup sourceInstance. - * @member {string} sourceInstance - * @memberof google.cloud.filestore.v1beta1.Backup + * Share description. + * @member {string} description + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.sourceInstance = ""; + Share.prototype.description = ""; /** - * Backup sourceFileShare. - * @member {string} sourceFileShare - * @memberof google.cloud.filestore.v1beta1.Backup + * Share capacityGb. + * @member {number|Long} capacityGb + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.sourceFileShare = ""; + Share.prototype.capacityGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; /** - * Backup sourceInstanceTier. - * @member {google.cloud.filestore.v1beta1.Instance.Tier} sourceInstanceTier - * @memberof google.cloud.filestore.v1beta1.Backup + * Share nfsExportOptions. + * @member {Array.} nfsExportOptions + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.sourceInstanceTier = 0; + Share.prototype.nfsExportOptions = $util.emptyArray; /** - * Backup downloadBytes. - * @member {number|Long} downloadBytes - * @memberof google.cloud.filestore.v1beta1.Backup + * Share state. + * @member {google.cloud.filestore.v1beta1.Share.State} state + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.downloadBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + Share.prototype.state = 0; /** - * Backup satisfiesPzs. - * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs - * @memberof google.cloud.filestore.v1beta1.Backup + * Share createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.filestore.v1beta1.Share * @instance */ - Backup.prototype.satisfiesPzs = null; + Share.prototype.createTime = null; /** - * Creates a new Backup instance using the specified properties. + * Share labels. + * @member {Object.} labels + * @memberof google.cloud.filestore.v1beta1.Share + * @instance + */ + Share.prototype.labels = $util.emptyObject; + + /** + * Creates a new Share instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static - * @param {google.cloud.filestore.v1beta1.IBackup=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.Backup} Backup instance + * @param {google.cloud.filestore.v1beta1.IShare=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.Share} Share instance */ - Backup.create = function create(properties) { - return new Backup(properties); + Share.create = function create(properties) { + return new Share(properties); }; /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * Encodes the specified Share message. Does not implicitly {@link google.cloud.filestore.v1beta1.Share.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static - * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IShare} message Share message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Backup.encode = function encode(message, writer) { + Share.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.mountName != null && Object.hasOwnProperty.call(message, "mountName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.mountName); if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.capacityGb); + if (message.nfsExportOptions != null && message.nfsExportOptions.length) + for (var i = 0; i < message.nfsExportOptions.length; ++i) + $root.google.cloud.filestore.v1beta1.NfsExportOptions.encode(message.nfsExportOptions[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.state); if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + $root.google.protobuf.Timestamp.encode(message.createTime, 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 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.capacityGb != null && Object.hasOwnProperty.call(message, "capacityGb")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.capacityGb); - if (message.storageBytes != null && Object.hasOwnProperty.call(message, "storageBytes")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.storageBytes); - if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.sourceInstance); - if (message.sourceFileShare != null && Object.hasOwnProperty.call(message, "sourceFileShare")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.sourceFileShare); - if (message.sourceInstanceTier != null && Object.hasOwnProperty.call(message, "sourceInstanceTier")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.sourceInstanceTier); - if (message.downloadBytes != null && Object.hasOwnProperty.call(message, "downloadBytes")) - writer.uint32(/* id 11, wireType 0 =*/88).int64(message.downloadBytes); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + 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(); return writer; }; /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Backup.verify|verify} messages. + * Encodes the specified Share message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.Share.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static - * @param {google.cloud.filestore.v1beta1.IBackup} message Backup message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IShare} message Share message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { + Share.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Backup message from the specified reader or buffer. + * Decodes a Share message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @returns {google.cloud.filestore.v1beta1.Share} Share * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decode = function decode(reader, length) { + Share.decode = function 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.filestore.v1beta1.Backup(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.Share(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11030,18 +15564,32 @@ break; } case 2: { - message.description = reader.string(); + message.mountName = reader.string(); break; } case 3: { - message.state = reader.int32(); + message.description = reader.string(); break; } case 4: { + message.capacityGb = reader.int64(); + break; + } + case 5: { + if (!(message.nfsExportOptions && message.nfsExportOptions.length)) + message.nfsExportOptions = []; + message.nfsExportOptions.push($root.google.cloud.filestore.v1beta1.NfsExportOptions.decode(reader, reader.uint32())); + break; + } + case 6: { + message.state = reader.int32(); + break; + } + case 7: { message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; } - case 5: { + case 8: { if (message.labels === $util.emptyObject) message.labels = {}; var end2 = reader.uint32() + reader.pos; @@ -11064,34 +15612,6 @@ message.labels[key] = value; break; } - case 6: { - message.capacityGb = reader.int64(); - break; - } - case 7: { - message.storageBytes = reader.int64(); - break; - } - case 8: { - message.sourceInstance = reader.string(); - break; - } - case 9: { - message.sourceFileShare = reader.string(); - break; - } - case 10: { - message.sourceInstanceTier = reader.int32(); - break; - } - case 11: { - message.downloadBytes = reader.int64(); - break; - } - case 12: { - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } default: reader.skipType(tag & 7); break; @@ -11101,45 +15621,59 @@ }; /** - * Decodes a Backup message from the specified reader or buffer, length delimited. + * Decodes a Share message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @returns {google.cloud.filestore.v1beta1.Share} Share * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Backup.decodeDelimited = function decodeDelimited(reader) { + Share.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Backup message. + * Verifies a Share message. * @function verify - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Backup.verify = function verify(message) { + Share.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.mountName != null && message.hasOwnProperty("mountName")) + if (!$util.isString(message.mountName)) + return "mountName: string expected"; if (message.description != null && message.hasOwnProperty("description")) if (!$util.isString(message.description)) return "description: string expected"; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) + return "capacityGb: integer|Long expected"; + if (message.nfsExportOptions != null && message.hasOwnProperty("nfsExportOptions")) { + if (!Array.isArray(message.nfsExportOptions)) + return "nfsExportOptions: array expected"; + for (var i = 0; i < message.nfsExportOptions.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.NfsExportOptions.verify(message.nfsExportOptions[i]); + if (error) + return "nfsExportOptions." + error; + } + } if (message.state != null && message.hasOwnProperty("state")) switch (message.state) { default: return "state: enum value expected"; case 0: case 1: - case 2: case 3: case 4: break; @@ -11157,57 +15691,46 @@ if (!$util.isString(message.labels[key[i]])) return "labels: string{k:string} expected"; } - if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) - if (!$util.isInteger(message.capacityGb) && !(message.capacityGb && $util.isInteger(message.capacityGb.low) && $util.isInteger(message.capacityGb.high))) - return "capacityGb: integer|Long expected"; - if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) - if (!$util.isInteger(message.storageBytes) && !(message.storageBytes && $util.isInteger(message.storageBytes.low) && $util.isInteger(message.storageBytes.high))) - return "storageBytes: integer|Long expected"; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - if (!$util.isString(message.sourceInstance)) - return "sourceInstance: string expected"; - if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) - if (!$util.isString(message.sourceFileShare)) - return "sourceFileShare: string expected"; - if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) - switch (message.sourceInstanceTier) { - default: - return "sourceInstanceTier: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 6: - break; - } - if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) - if (!$util.isInteger(message.downloadBytes) && !(message.downloadBytes && $util.isInteger(message.downloadBytes.low) && $util.isInteger(message.downloadBytes.high))) - return "downloadBytes: integer|Long expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { - var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); - if (error) - return "satisfiesPzs." + error; - } return null; }; /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * Creates a Share message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.Backup} Backup + * @returns {google.cloud.filestore.v1beta1.Share} Share */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.Backup) + Share.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.Share) return object; - var message = new $root.google.cloud.filestore.v1beta1.Backup(); + var message = new $root.google.cloud.filestore.v1beta1.Share(); if (object.name != null) message.name = String(object.name); + if (object.mountName != null) + message.mountName = String(object.mountName); if (object.description != null) message.description = String(object.description); + if (object.capacityGb != null) + if ($util.Long) + (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; + else if (typeof object.capacityGb === "string") + message.capacityGb = parseInt(object.capacityGb, 10); + else if (typeof object.capacityGb === "number") + message.capacityGb = object.capacityGb; + else if (typeof object.capacityGb === "object") + message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); + if (object.nfsExportOptions) { + if (!Array.isArray(object.nfsExportOptions)) + throw TypeError(".google.cloud.filestore.v1beta1.Share.nfsExportOptions: array expected"); + message.nfsExportOptions = []; + for (var i = 0; i < object.nfsExportOptions.length; ++i) { + if (typeof object.nfsExportOptions[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.Share.nfsExportOptions: object expected"); + message.nfsExportOptions[i] = $root.google.cloud.filestore.v1beta1.NfsExportOptions.fromObject(object.nfsExportOptions[i]); + } + } switch (object.state) { default: if (typeof object.state === "number") { @@ -11223,10 +15746,6 @@ case 1: message.state = 1; break; - case "FINALIZING": - case 2: - message.state = 2; - break; case "READY": case 3: message.state = 3; @@ -11238,133 +15757,66 @@ } if (object.createTime != null) { if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.Backup.createTime: object expected"); + throw TypeError(".google.cloud.filestore.v1beta1.Share.createTime: object expected"); message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } if (object.labels) { if (typeof object.labels !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.Backup.labels: object expected"); + throw TypeError(".google.cloud.filestore.v1beta1.Share.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.capacityGb != null) - if ($util.Long) - (message.capacityGb = $util.Long.fromValue(object.capacityGb)).unsigned = false; - else if (typeof object.capacityGb === "string") - message.capacityGb = parseInt(object.capacityGb, 10); - else if (typeof object.capacityGb === "number") - message.capacityGb = object.capacityGb; - else if (typeof object.capacityGb === "object") - message.capacityGb = new $util.LongBits(object.capacityGb.low >>> 0, object.capacityGb.high >>> 0).toNumber(); - if (object.storageBytes != null) - if ($util.Long) - (message.storageBytes = $util.Long.fromValue(object.storageBytes)).unsigned = false; - else if (typeof object.storageBytes === "string") - message.storageBytes = parseInt(object.storageBytes, 10); - else if (typeof object.storageBytes === "number") - message.storageBytes = object.storageBytes; - else if (typeof object.storageBytes === "object") - message.storageBytes = new $util.LongBits(object.storageBytes.low >>> 0, object.storageBytes.high >>> 0).toNumber(); - if (object.sourceInstance != null) - message.sourceInstance = String(object.sourceInstance); - if (object.sourceFileShare != null) - message.sourceFileShare = String(object.sourceFileShare); - switch (object.sourceInstanceTier) { - default: - if (typeof object.sourceInstanceTier === "number") { - message.sourceInstanceTier = object.sourceInstanceTier; - break; - } - break; - case "TIER_UNSPECIFIED": - case 0: - message.sourceInstanceTier = 0; - break; - case "STANDARD": - case 1: - message.sourceInstanceTier = 1; - break; - case "PREMIUM": - case 2: - message.sourceInstanceTier = 2; - break; - case "BASIC_HDD": - case 3: - message.sourceInstanceTier = 3; - break; - case "BASIC_SSD": - case 4: - message.sourceInstanceTier = 4; - break; - case "HIGH_SCALE_SSD": - case 6: - message.sourceInstanceTier = 6; - break; - } - if (object.downloadBytes != null) - if ($util.Long) - (message.downloadBytes = $util.Long.fromValue(object.downloadBytes)).unsigned = false; - else if (typeof object.downloadBytes === "string") - message.downloadBytes = parseInt(object.downloadBytes, 10); - else if (typeof object.downloadBytes === "number") - message.downloadBytes = object.downloadBytes; - else if (typeof object.downloadBytes === "object") - message.downloadBytes = new $util.LongBits(object.downloadBytes.low >>> 0, object.downloadBytes.high >>> 0).toNumber(); - if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.Backup.satisfiesPzs: object expected"); - message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); - } return message; }; /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. + * Creates a plain object from a Share message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static - * @param {google.cloud.filestore.v1beta1.Backup} message Backup + * @param {google.cloud.filestore.v1beta1.Share} message Share * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Backup.toObject = function toObject(message, options) { + Share.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.nfsExportOptions = []; if (options.objects || options.defaults) object.labels = {}; if (options.defaults) { object.name = ""; + object.mountName = ""; object.description = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.createTime = null; if ($util.Long) { var long = new $util.Long(0, 0, false); object.capacityGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.capacityGb = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.storageBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.storageBytes = options.longs === String ? "0" : 0; - object.sourceInstance = ""; - object.sourceFileShare = ""; - object.sourceInstanceTier = options.enums === String ? "TIER_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.downloadBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.downloadBytes = options.longs === String ? "0" : 0; - object.satisfiesPzs = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.createTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.mountName != null && message.hasOwnProperty("mountName")) + object.mountName = message.mountName; if (message.description != null && message.hasOwnProperty("description")) object.description = message.description; + if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) + if (typeof message.capacityGb === "number") + object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; + else + object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; + if (message.nfsExportOptions && message.nfsExportOptions.length) { + object.nfsExportOptions = []; + for (var j = 0; j < message.nfsExportOptions.length; ++j) + object.nfsExportOptions[j] = $root.google.cloud.filestore.v1beta1.NfsExportOptions.toObject(message.nfsExportOptions[j], options); + } if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Backup.State[message.state] : message.state; + object.state = options.enums === String ? $root.google.cloud.filestore.v1beta1.Share.State[message.state] === undefined ? message.state : $root.google.cloud.filestore.v1beta1.Share.State[message.state] : message.state; if (message.createTime != null && message.hasOwnProperty("createTime")) object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); var keys2; @@ -11373,101 +15825,76 @@ for (var j = 0; j < keys2.length; ++j) object.labels[keys2[j]] = message.labels[keys2[j]]; } - if (message.capacityGb != null && message.hasOwnProperty("capacityGb")) - if (typeof message.capacityGb === "number") - object.capacityGb = options.longs === String ? String(message.capacityGb) : message.capacityGb; - else - object.capacityGb = options.longs === String ? $util.Long.prototype.toString.call(message.capacityGb) : options.longs === Number ? new $util.LongBits(message.capacityGb.low >>> 0, message.capacityGb.high >>> 0).toNumber() : message.capacityGb; - if (message.storageBytes != null && message.hasOwnProperty("storageBytes")) - if (typeof message.storageBytes === "number") - object.storageBytes = options.longs === String ? String(message.storageBytes) : message.storageBytes; - else - object.storageBytes = options.longs === String ? $util.Long.prototype.toString.call(message.storageBytes) : options.longs === Number ? new $util.LongBits(message.storageBytes.low >>> 0, message.storageBytes.high >>> 0).toNumber() : message.storageBytes; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - object.sourceInstance = message.sourceInstance; - if (message.sourceFileShare != null && message.hasOwnProperty("sourceFileShare")) - object.sourceFileShare = message.sourceFileShare; - if (message.sourceInstanceTier != null && message.hasOwnProperty("sourceInstanceTier")) - object.sourceInstanceTier = options.enums === String ? $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] === undefined ? message.sourceInstanceTier : $root.google.cloud.filestore.v1beta1.Instance.Tier[message.sourceInstanceTier] : message.sourceInstanceTier; - if (message.downloadBytes != null && message.hasOwnProperty("downloadBytes")) - if (typeof message.downloadBytes === "number") - object.downloadBytes = options.longs === String ? String(message.downloadBytes) : message.downloadBytes; - else - object.downloadBytes = options.longs === String ? $util.Long.prototype.toString.call(message.downloadBytes) : options.longs === Number ? new $util.LongBits(message.downloadBytes.low >>> 0, message.downloadBytes.high >>> 0).toNumber() : message.downloadBytes; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); return object; }; /** - * Converts this Backup to JSON. + * Converts this Share to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @instance * @returns {Object.} JSON object */ - Backup.prototype.toJSON = function toJSON() { + Share.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for Backup + * Gets the default type url for Share * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.Backup + * @memberof google.cloud.filestore.v1beta1.Share * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + Share.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.Backup"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.Share"; }; /** * State enum. - * @name google.cloud.filestore.v1beta1.Backup.State + * @name google.cloud.filestore.v1beta1.Share.State * @enum {number} * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value * @property {number} CREATING=1 CREATING value - * @property {number} FINALIZING=2 FINALIZING value * @property {number} READY=3 READY value * @property {number} DELETING=4 DELETING value */ - Backup.State = (function() { + Share.State = (function() { var valuesById = {}, values = Object.create(valuesById); values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "FINALIZING"] = 2; values[valuesById[3] = "READY"] = 3; values[valuesById[4] = "DELETING"] = 4; return values; })(); - return Backup; + return Share; })(); - v1beta1.CreateBackupRequest = (function() { + v1beta1.CreateShareRequest = (function() { /** - * Properties of a CreateBackupRequest. - * @memberof google.cloud.filestore.v1beta1 - * @interface ICreateBackupRequest - * @property {string|null} [parent] CreateBackupRequest parent - * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] CreateBackupRequest backup - * @property {string|null} [backupId] CreateBackupRequest backupId + * Properties of a CreateShareRequest. + * @memberof google.cloud.filestore.v1beta1 + * @interface ICreateShareRequest + * @property {string|null} [parent] CreateShareRequest parent + * @property {string|null} [shareId] CreateShareRequest shareId + * @property {google.cloud.filestore.v1beta1.IShare|null} [share] CreateShareRequest share */ /** - * Constructs a new CreateBackupRequest. + * Constructs a new CreateShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a CreateBackupRequest. - * @implements ICreateBackupRequest + * @classdesc Represents a CreateShareRequest. + * @implements ICreateShareRequest * @constructor - * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest=} [properties] Properties to set */ - function CreateBackupRequest(properties) { + function CreateShareRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11475,90 +15902,90 @@ } /** - * CreateBackupRequest parent. + * CreateShareRequest parent. * @member {string} parent - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @instance */ - CreateBackupRequest.prototype.parent = ""; + CreateShareRequest.prototype.parent = ""; /** - * CreateBackupRequest backup. - * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * CreateShareRequest shareId. + * @member {string} shareId + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @instance */ - CreateBackupRequest.prototype.backup = null; + CreateShareRequest.prototype.shareId = ""; /** - * CreateBackupRequest backupId. - * @member {string} backupId - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * CreateShareRequest share. + * @member {google.cloud.filestore.v1beta1.IShare|null|undefined} share + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @instance */ - CreateBackupRequest.prototype.backupId = ""; + CreateShareRequest.prototype.share = null; /** - * Creates a new CreateBackupRequest instance using the specified properties. + * Creates a new CreateShareRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest instance + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.CreateShareRequest} CreateShareRequest instance */ - CreateBackupRequest.create = function create(properties) { - return new CreateBackupRequest(properties); + CreateShareRequest.create = function create(properties) { + return new CreateShareRequest(properties); }; /** - * Encodes the specified CreateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * Encodes the specified CreateShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateShareRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest} message CreateShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encode = function encode(message, writer) { + CreateShareRequest.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.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.backupId != null && Object.hasOwnProperty.call(message, "backupId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupId); + if (message.shareId != null && Object.hasOwnProperty.call(message, "shareId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.shareId); + if (message.share != null && Object.hasOwnProperty.call(message, "share")) + $root.google.cloud.filestore.v1beta1.Share.encode(message.share, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateBackupRequest.verify|verify} messages. + * Encodes the specified CreateShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.CreateShareRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.ICreateBackupRequest} message CreateBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.ICreateShareRequest} message CreateShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateShareRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer. + * Decodes a CreateShareRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.filestore.v1beta1.CreateShareRequest} CreateShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decode = function decode(reader, length) { + CreateShareRequest.decode = function 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.filestore.v1beta1.CreateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.CreateShareRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11567,11 +15994,11 @@ break; } case 2: { - message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); + message.shareId = reader.string(); break; } case 3: { - message.backupId = reader.string(); + message.share = $root.google.cloud.filestore.v1beta1.Share.decode(reader, reader.uint32()); break; } default: @@ -11583,144 +16010,144 @@ }; /** - * Decodes a CreateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateShareRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.filestore.v1beta1.CreateShareRequest} CreateShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + CreateShareRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateBackupRequest message. + * Verifies a CreateShareRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateBackupRequest.verify = function verify(message) { + CreateShareRequest.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.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); + if (message.shareId != null && message.hasOwnProperty("shareId")) + if (!$util.isString(message.shareId)) + return "shareId: string expected"; + if (message.share != null && message.hasOwnProperty("share")) { + var error = $root.google.cloud.filestore.v1beta1.Share.verify(message.share); if (error) - return "backup." + error; + return "share." + error; } - if (message.backupId != null && message.hasOwnProperty("backupId")) - if (!$util.isString(message.backupId)) - return "backupId: string expected"; return null; }; /** - * Creates a CreateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateShareRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.CreateBackupRequest} CreateBackupRequest + * @returns {google.cloud.filestore.v1beta1.CreateShareRequest} CreateShareRequest */ - CreateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.CreateBackupRequest) + CreateShareRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.CreateShareRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.CreateBackupRequest(); + var message = new $root.google.cloud.filestore.v1beta1.CreateShareRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.CreateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); + if (object.shareId != null) + message.shareId = String(object.shareId); + if (object.share != null) { + if (typeof object.share !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.CreateShareRequest.share: object expected"); + message.share = $root.google.cloud.filestore.v1beta1.Share.fromObject(object.share); } - if (object.backupId != null) - message.backupId = String(object.backupId); return message; }; /** - * Creates a plain object from a CreateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateShareRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.CreateBackupRequest} message CreateBackupRequest + * @param {google.cloud.filestore.v1beta1.CreateShareRequest} message CreateShareRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateBackupRequest.toObject = function toObject(message, options) { + CreateShareRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.backup = null; - object.backupId = ""; + object.shareId = ""; + object.share = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); - if (message.backupId != null && message.hasOwnProperty("backupId")) - object.backupId = message.backupId; + if (message.shareId != null && message.hasOwnProperty("shareId")) + object.shareId = message.shareId; + if (message.share != null && message.hasOwnProperty("share")) + object.share = $root.google.cloud.filestore.v1beta1.Share.toObject(message.share, options); return object; }; /** - * Converts this CreateBackupRequest to JSON. + * Converts this CreateShareRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @instance * @returns {Object.} JSON object */ - CreateBackupRequest.prototype.toJSON = function toJSON() { + CreateShareRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for CreateBackupRequest + * Gets the default type url for CreateShareRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.CreateBackupRequest + * @memberof google.cloud.filestore.v1beta1.CreateShareRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - CreateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + CreateShareRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.CreateBackupRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.CreateShareRequest"; }; - return CreateBackupRequest; + return CreateShareRequest; })(); - v1beta1.DeleteBackupRequest = (function() { + v1beta1.GetShareRequest = (function() { /** - * Properties of a DeleteBackupRequest. + * Properties of a GetShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name + * @interface IGetShareRequest + * @property {string|null} [name] GetShareRequest name */ /** - * Constructs a new DeleteBackupRequest. + * Constructs a new GetShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest + * @classdesc Represents a GetShareRequest. + * @implements IGetShareRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IGetShareRequest=} [properties] Properties to set */ - function DeleteBackupRequest(properties) { + function GetShareRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11728,35 +16155,35 @@ } /** - * DeleteBackupRequest name. + * GetShareRequest name. * @member {string} name - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @instance */ - DeleteBackupRequest.prototype.name = ""; + GetShareRequest.prototype.name = ""; /** - * Creates a new DeleteBackupRequest instance using the specified properties. + * Creates a new GetShareRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest instance + * @param {google.cloud.filestore.v1beta1.IGetShareRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.GetShareRequest} GetShareRequest instance */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); + GetShareRequest.create = function create(properties) { + return new GetShareRequest(properties); }; /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified GetShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetShareRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IGetShareRequest} message GetShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encode = function encode(message, writer) { + GetShareRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -11765,33 +16192,33 @@ }; /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteBackupRequest.verify|verify} messages. + * Encodes the specified GetShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetShareRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IGetShareRequest} message GetShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetShareRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * Decodes a GetShareRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.filestore.v1beta1.GetShareRequest} GetShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decode = function decode(reader, length) { + GetShareRequest.decode = function 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.filestore.v1beta1.DeleteBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.GetShareRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -11808,30 +16235,30 @@ }; /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a GetShareRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.filestore.v1beta1.GetShareRequest} GetShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + GetShareRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteBackupRequest message. + * Verifies a GetShareRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteBackupRequest.verify = function verify(message) { + GetShareRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -11841,32 +16268,32 @@ }; /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetShareRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.DeleteBackupRequest} DeleteBackupRequest + * @returns {google.cloud.filestore.v1beta1.GetShareRequest} GetShareRequest */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteBackupRequest) + GetShareRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.GetShareRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.DeleteBackupRequest(); + var message = new $root.google.cloud.filestore.v1beta1.GetShareRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetShareRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static - * @param {google.cloud.filestore.v1beta1.DeleteBackupRequest} message DeleteBackupRequest + * @param {google.cloud.filestore.v1beta1.GetShareRequest} message GetShareRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteBackupRequest.toObject = function toObject(message, options) { + GetShareRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -11878,53 +16305,52 @@ }; /** - * Converts this DeleteBackupRequest to JSON. + * Converts this GetShareRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @instance * @returns {Object.} JSON object */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { + GetShareRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for DeleteBackupRequest + * Gets the default type url for GetShareRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.DeleteBackupRequest + * @memberof google.cloud.filestore.v1beta1.GetShareRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + GetShareRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteBackupRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.GetShareRequest"; }; - return DeleteBackupRequest; + return GetShareRequest; })(); - v1beta1.UpdateBackupRequest = (function() { + v1beta1.DeleteShareRequest = (function() { /** - * Properties of an UpdateBackupRequest. + * Properties of a DeleteShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IUpdateBackupRequest - * @property {google.cloud.filestore.v1beta1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @interface IDeleteShareRequest + * @property {string|null} [name] DeleteShareRequest name */ /** - * Constructs a new UpdateBackupRequest. + * Constructs a new DeleteShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest + * @classdesc Represents a DeleteShareRequest. + * @implements IDeleteShareRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest=} [properties] Properties to set */ - function UpdateBackupRequest(properties) { + function DeleteShareRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11932,89 +16358,75 @@ } /** - * UpdateBackupRequest backup. - * @member {google.cloud.filestore.v1beta1.IBackup|null|undefined} backup - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * DeleteShareRequest name. + * @member {string} name + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @instance */ - UpdateBackupRequest.prototype.updateMask = null; + DeleteShareRequest.prototype.name = ""; /** - * Creates a new UpdateBackupRequest instance using the specified properties. + * Creates a new DeleteShareRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest instance + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.DeleteShareRequest} DeleteShareRequest instance */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); + DeleteShareRequest.create = function create(properties) { + return new DeleteShareRequest(properties); }; /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified DeleteShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteShareRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest} message DeleteShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encode = function encode(message, writer) { + DeleteShareRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.filestore.v1beta1.Backup.encode(message.backup, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateBackupRequest.verify|verify} messages. + * Encodes the specified DeleteShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.DeleteShareRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IDeleteShareRequest} message DeleteShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteShareRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * Decodes a DeleteShareRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.filestore.v1beta1.DeleteShareRequest} DeleteShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decode = function decode(reader, length) { + DeleteShareRequest.decode = function 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.filestore.v1beta1.UpdateBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.DeleteShareRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.backup = $root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; } default: @@ -12026,141 +16438,126 @@ }; /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteShareRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.filestore.v1beta1.DeleteShareRequest} DeleteShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteShareRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateBackupRequest message. + * Verifies a DeleteShareRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateBackupRequest.verify = function verify(message) { + DeleteShareRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteShareRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.UpdateBackupRequest} UpdateBackupRequest + * @returns {google.cloud.filestore.v1beta1.DeleteShareRequest} DeleteShareRequest */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateBackupRequest) + DeleteShareRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.DeleteShareRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.UpdateBackupRequest(); - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backup); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.filestore.v1beta1.DeleteShareRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteShareRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static - * @param {google.cloud.filestore.v1beta1.UpdateBackupRequest} message UpdateBackupRequest + * @param {google.cloud.filestore.v1beta1.DeleteShareRequest} message DeleteShareRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateBackupRequest.toObject = function toObject(message, options) { + DeleteShareRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.backup = null; - object.updateMask = null; - } - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backup, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this UpdateBackupRequest to JSON. + * Converts this DeleteShareRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @instance * @returns {Object.} JSON object */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { + DeleteShareRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for UpdateBackupRequest + * Gets the default type url for DeleteShareRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.UpdateBackupRequest + * @memberof google.cloud.filestore.v1beta1.DeleteShareRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + DeleteShareRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.UpdateBackupRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.DeleteShareRequest"; }; - return UpdateBackupRequest; + return DeleteShareRequest; })(); - v1beta1.GetBackupRequest = (function() { + v1beta1.ListSharesRequest = (function() { /** - * Properties of a GetBackupRequest. + * Properties of a ListSharesRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name + * @interface IListSharesRequest + * @property {string|null} [parent] ListSharesRequest parent + * @property {number|null} [pageSize] ListSharesRequest pageSize + * @property {string|null} [pageToken] ListSharesRequest pageToken + * @property {string|null} [orderBy] ListSharesRequest orderBy + * @property {string|null} [filter] ListSharesRequest filter */ /** - * Constructs a new GetBackupRequest. + * Constructs a new ListSharesRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest + * @classdesc Represents a ListSharesRequest. + * @implements IListSharesRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IListSharesRequest=} [properties] Properties to set */ - function GetBackupRequest(properties) { + function ListSharesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12168,75 +16565,131 @@ } /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * ListSharesRequest parent. + * @member {string} parent + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @instance */ - GetBackupRequest.prototype.name = ""; + ListSharesRequest.prototype.parent = ""; /** - * Creates a new GetBackupRequest instance using the specified properties. + * ListSharesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest + * @instance + */ + ListSharesRequest.prototype.pageSize = 0; + + /** + * ListSharesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest + * @instance + */ + ListSharesRequest.prototype.pageToken = ""; + + /** + * ListSharesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest + * @instance + */ + ListSharesRequest.prototype.orderBy = ""; + + /** + * ListSharesRequest filter. + * @member {string} filter + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest + * @instance + */ + ListSharesRequest.prototype.filter = ""; + + /** + * Creates a new ListSharesRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static - * @param {google.cloud.filestore.v1beta1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest instance + * @param {google.cloud.filestore.v1beta1.IListSharesRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListSharesRequest} ListSharesRequest instance */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); + ListSharesRequest.create = function create(properties) { + return new ListSharesRequest(properties); }; /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * Encodes the specified ListSharesRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static - * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IListSharesRequest} message ListSharesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encode = function encode(message, writer) { + ListSharesRequest.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.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); return writer; }; /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.GetBackupRequest.verify|verify} messages. + * Encodes the specified ListSharesRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static - * @param {google.cloud.filestore.v1beta1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IListSharesRequest} message ListSharesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSharesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer. + * Decodes a ListSharesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesRequest} ListSharesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decode = function decode(reader, length) { + ListSharesRequest.decode = function 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.filestore.v1beta1.GetBackupRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.ListSharesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.name = reader.string(); + message.parent = reader.string(); + break; + } + case 2: { + message.pageSize = reader.int32(); + break; + } + case 3: { + message.pageToken = reader.string(); + break; + } + case 4: { + message.orderBy = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); break; } default: @@ -12248,126 +16701,159 @@ }; /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSharesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesRequest} ListSharesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + ListSharesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetBackupRequest message. + * Verifies a ListSharesRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetBackupRequest.verify = function verify(message) { + ListSharesRequest.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.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.orderBy != null && message.hasOwnProperty("orderBy")) + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSharesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.GetBackupRequest} GetBackupRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesRequest} ListSharesRequest */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.GetBackupRequest) + ListSharesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListSharesRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.filestore.v1beta1.ListSharesRequest(); + 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.orderBy != null) + message.orderBy = String(object.orderBy); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSharesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static - * @param {google.cloud.filestore.v1beta1.GetBackupRequest} message GetBackupRequest + * @param {google.cloud.filestore.v1beta1.ListSharesRequest} message ListSharesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetBackupRequest.toObject = function toObject(message, options) { + ListSharesRequest.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; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.orderBy = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = message.orderBy; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this GetBackupRequest to JSON. + * Converts this ListSharesRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @instance * @returns {Object.} JSON object */ - GetBackupRequest.prototype.toJSON = function toJSON() { + ListSharesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for GetBackupRequest + * Gets the default type url for ListSharesRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.GetBackupRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSharesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.GetBackupRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListSharesRequest"; }; - return GetBackupRequest; + return ListSharesRequest; })(); - v1beta1.ListBackupsRequest = (function() { + v1beta1.ListSharesResponse = (function() { /** - * Properties of a ListBackupsRequest. + * Properties of a ListSharesResponse. * @memberof google.cloud.filestore.v1beta1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [orderBy] ListBackupsRequest orderBy - * @property {string|null} [filter] ListBackupsRequest filter + * @interface IListSharesResponse + * @property {Array.|null} [shares] ListSharesResponse shares + * @property {string|null} [nextPageToken] ListSharesResponse nextPageToken + * @property {Array.|null} [unreachable] ListSharesResponse unreachable */ /** - * Constructs a new ListBackupsRequest. + * Constructs a new ListSharesResponse. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest + * @classdesc Represents a ListSharesResponse. + * @implements IListSharesResponse * @constructor - * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IListSharesResponse=} [properties] Properties to set */ - function ListBackupsRequest(properties) { + function ListSharesResponse(properties) { + this.shares = []; + this.unreachable = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12375,131 +16861,109 @@ } /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * ListSharesResponse shares. + * @member {Array.} shares + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @instance */ - ListBackupsRequest.prototype.pageToken = ""; + ListSharesResponse.prototype.shares = $util.emptyArray; /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * ListSharesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @instance */ - ListBackupsRequest.prototype.orderBy = ""; + ListSharesResponse.prototype.nextPageToken = ""; /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * ListSharesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @instance */ - ListBackupsRequest.prototype.filter = ""; + ListSharesResponse.prototype.unreachable = $util.emptyArray; /** - * Creates a new ListBackupsRequest instance using the specified properties. + * Creates a new ListSharesResponse instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest instance + * @param {google.cloud.filestore.v1beta1.IListSharesResponse=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.ListSharesResponse} ListSharesResponse instance */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); + ListSharesResponse.create = function create(properties) { + return new ListSharesResponse(properties); }; /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListSharesResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IListSharesResponse} message ListSharesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encode = function encode(message, writer) { + ListSharesResponse.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.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.orderBy); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.shares != null && message.shares.length) + for (var i = 0; i < message.shares.length; ++i) + $root.google.cloud.filestore.v1beta1.Share.encode(message.shares[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 ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsRequest.verify|verify} messages. + * Encodes the specified ListSharesResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListSharesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IListSharesResponse} message ListSharesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSharesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. + * Decodes a ListSharesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesResponse} ListSharesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decode = function decode(reader, length) { + ListSharesResponse.decode = function 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.filestore.v1beta1.ListBackupsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.ListSharesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - message.parent = reader.string(); + if (!(message.shares && message.shares.length)) + message.shares = []; + message.shares.push($root.google.cloud.filestore.v1beta1.Share.decode(reader, reader.uint32())); break; } case 2: { - message.pageSize = reader.int32(); + message.nextPageToken = reader.string(); break; } case 3: { - message.pageToken = reader.string(); - break; - } - case 4: { - message.orderBy = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); + if (!(message.unreachable && message.unreachable.length)) + message.unreachable = []; + message.unreachable.push(reader.string()); break; } default: @@ -12511,159 +16975,170 @@ }; /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSharesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesResponse} ListSharesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + ListSharesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsRequest message. + * Verifies a ListSharesResponse message. * @function verify - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsRequest.verify = function verify(message) { + ListSharesResponse.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.orderBy != null && message.hasOwnProperty("orderBy")) - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.shares != null && message.hasOwnProperty("shares")) { + if (!Array.isArray(message.shares)) + return "shares: array expected"; + for (var i = 0; i < message.shares.length; ++i) { + var error = $root.google.cloud.filestore.v1beta1.Share.verify(message.shares[i]); + if (error) + return "shares." + 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 ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSharesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.ListBackupsRequest} ListBackupsRequest + * @returns {google.cloud.filestore.v1beta1.ListSharesResponse} ListSharesResponse */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsRequest) + ListSharesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.ListSharesResponse) return object; - var message = new $root.google.cloud.filestore.v1beta1.ListBackupsRequest(); - 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.orderBy != null) - message.orderBy = String(object.orderBy); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.filestore.v1beta1.ListSharesResponse(); + if (object.shares) { + if (!Array.isArray(object.shares)) + throw TypeError(".google.cloud.filestore.v1beta1.ListSharesResponse.shares: array expected"); + message.shares = []; + for (var i = 0; i < object.shares.length; ++i) { + if (typeof object.shares[i] !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.ListSharesResponse.shares: object expected"); + message.shares[i] = $root.google.cloud.filestore.v1beta1.Share.fromObject(object.shares[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.filestore.v1beta1.ListSharesResponse.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 ListBackupsRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSharesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static - * @param {google.cloud.filestore.v1beta1.ListBackupsRequest} message ListBackupsRequest + * @param {google.cloud.filestore.v1beta1.ListSharesResponse} message ListSharesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsRequest.toObject = function toObject(message, options) { + ListSharesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.orderBy = ""; - object.filter = ""; + if (options.arrays || options.defaults) { + object.shares = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.shares && message.shares.length) { + object.shares = []; + for (var j = 0; j < message.shares.length; ++j) + object.shares[j] = $root.google.cloud.filestore.v1beta1.Share.toObject(message.shares[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]; } - 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.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = message.orderBy; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; return object; }; /** - * Converts this ListBackupsRequest to JSON. + * Converts this ListSharesResponse to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @instance * @returns {Object.} JSON object */ - ListBackupsRequest.prototype.toJSON = function toJSON() { + ListSharesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsRequest + * Gets the default type url for ListSharesResponse * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.ListBackupsRequest + * @memberof google.cloud.filestore.v1beta1.ListSharesResponse * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + ListSharesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsRequest"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListSharesResponse"; }; - return ListBackupsRequest; + return ListSharesResponse; })(); - v1beta1.ListBackupsResponse = (function() { + v1beta1.UpdateShareRequest = (function() { /** - * Properties of a ListBackupsResponse. + * Properties of an UpdateShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + * @interface IUpdateShareRequest + * @property {google.cloud.filestore.v1beta1.IShare|null} [share] UpdateShareRequest share + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateShareRequest updateMask */ /** - * Constructs a new ListBackupsResponse. + * Constructs a new UpdateShareRequest. * @memberof google.cloud.filestore.v1beta1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse + * @classdesc Represents an UpdateShareRequest. + * @implements IUpdateShareRequest * @constructor - * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest=} [properties] Properties to set */ - function ListBackupsResponse(properties) { - this.backups = []; - this.unreachable = []; + function UpdateShareRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12671,109 +17146,89 @@ } /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * UpdateShareRequest share. + * @member {google.cloud.filestore.v1beta1.IShare|null|undefined} share + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @instance */ - ListBackupsResponse.prototype.nextPageToken = ""; + UpdateShareRequest.prototype.share = null; /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * UpdateShareRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @instance */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; + UpdateShareRequest.prototype.updateMask = null; /** - * Creates a new ListBackupsResponse instance using the specified properties. + * Creates a new UpdateShareRequest instance using the specified properties. * @function create - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse instance + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest=} [properties] Properties to set + * @returns {google.cloud.filestore.v1beta1.UpdateShareRequest} UpdateShareRequest instance */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); + UpdateShareRequest.create = function create(properties) { + return new UpdateShareRequest(properties); }; /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * Encodes the specified UpdateShareRequest message. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateShareRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest} message UpdateShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encode = function encode(message, writer) { + UpdateShareRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.filestore.v1beta1.Backup.encode(message.backups[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]); + if (message.share != null && Object.hasOwnProperty.call(message, "share")) + $root.google.cloud.filestore.v1beta1.Share.encode(message.share, 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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.ListBackupsResponse.verify|verify} messages. + * Encodes the specified UpdateShareRequest message, length delimited. Does not implicitly {@link google.cloud.filestore.v1beta1.UpdateShareRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {google.cloud.filestore.v1beta1.IUpdateShareRequest} message UpdateShareRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + UpdateShareRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. + * Decodes an UpdateShareRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.filestore.v1beta1.UpdateShareRequest} UpdateShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decode = function decode(reader, length) { + UpdateShareRequest.decode = function 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.filestore.v1beta1.ListBackupsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.filestore.v1beta1.UpdateShareRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.filestore.v1beta1.Backup.decode(reader, reader.uint32())); + message.share = $root.google.cloud.filestore.v1beta1.Share.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()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; } default: @@ -12785,149 +17240,121 @@ }; /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateShareRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.filestore.v1beta1.UpdateShareRequest} UpdateShareRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + UpdateShareRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListBackupsResponse message. + * Verifies an UpdateShareRequest message. * @function verify - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListBackupsResponse.verify = function verify(message) { + UpdateShareRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.filestore.v1beta1.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } + if (message.share != null && message.hasOwnProperty("share")) { + var error = $root.google.cloud.filestore.v1beta1.Share.verify(message.share); + if (error) + return "share." + 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"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateShareRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.filestore.v1beta1.ListBackupsResponse} ListBackupsResponse + * @returns {google.cloud.filestore.v1beta1.UpdateShareRequest} UpdateShareRequest */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.filestore.v1beta1.ListBackupsResponse) + UpdateShareRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.filestore.v1beta1.UpdateShareRequest) return object; - var message = new $root.google.cloud.filestore.v1beta1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.filestore.v1beta1.Backup.fromObject(object.backups[i]); - } + var message = new $root.google.cloud.filestore.v1beta1.UpdateShareRequest(); + if (object.share != null) { + if (typeof object.share !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateShareRequest.share: object expected"); + message.share = $root.google.cloud.filestore.v1beta1.Share.fromObject(object.share); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.filestore.v1beta1.ListBackupsResponse.unreachable: array expected"); - message.unreachable = []; - for (var i = 0; i < object.unreachable.length; ++i) - message.unreachable[i] = String(object.unreachable[i]); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.filestore.v1beta1.UpdateShareRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * Creates a plain object from an UpdateShareRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static - * @param {google.cloud.filestore.v1beta1.ListBackupsResponse} message ListBackupsResponse + * @param {google.cloud.filestore.v1beta1.UpdateShareRequest} message UpdateShareRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListBackupsResponse.toObject = function toObject(message, options) { + UpdateShareRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.filestore.v1beta1.Backup.toObject(message.backups[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]; + if (options.defaults) { + object.share = null; + object.updateMask = null; } + if (message.share != null && message.hasOwnProperty("share")) + object.share = $root.google.cloud.filestore.v1beta1.Share.toObject(message.share, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListBackupsResponse to JSON. + * Converts this UpdateShareRequest to JSON. * @function toJSON - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @instance * @returns {Object.} JSON object */ - ListBackupsResponse.prototype.toJSON = function toJSON() { + UpdateShareRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; /** - * Gets the default type url for ListBackupsResponse + * Gets the default type url for UpdateShareRequest * @function getTypeUrl - * @memberof google.cloud.filestore.v1beta1.ListBackupsResponse + * @memberof google.cloud.filestore.v1beta1.UpdateShareRequest * @static * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") * @returns {string} The default type url */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + UpdateShareRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { if (typeUrlPrefix === undefined) { typeUrlPrefix = "type.googleapis.com"; } - return typeUrlPrefix + "/google.cloud.filestore.v1beta1.ListBackupsResponse"; + return typeUrlPrefix + "/google.cloud.filestore.v1beta1.UpdateShareRequest"; }; - return ListBackupsResponse; + return UpdateShareRequest; })(); return v1beta1; diff --git a/packages/google-cloud-filestore/protos/protos.json b/packages/google-cloud-filestore/protos/protos.json index 7552cc6a6bc..a6a3cabaf67 100644 --- a/packages/google-cloud-filestore/protos/protos.json +++ b/packages/google-cloud-filestore/protos/protos.json @@ -1028,6 +1028,30 @@ } ] }, + "RevertInstance": { + "requestType": "RevertInstanceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{name=projects/*/locations/*/instances/*}:revert", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "Instance", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{name=projects/*/locations/*/instances/*}:revert", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Instance", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, "DeleteInstance": { "requestType": "DeleteInstanceRequest", "responseType": "google.longrunning.Operation", @@ -1054,6 +1078,124 @@ } ] }, + "ListSnapshots": { + "requestType": "ListSnapshotsRequest", + "responseType": "ListSnapshotsResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSnapshot": { + "requestType": "GetSnapshotRequest", + "responseType": "Snapshot", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSnapshot": { + "requestType": "CreateSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots", + "(google.api.http).body": "snapshot", + "(google.api.method_signature)": "parent,snapshot,snapshot_id", + "(google.longrunning.operation_info).response_type": "Snapshot", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/snapshots", + "body": "snapshot" + } + }, + { + "(google.api.method_signature)": "parent,snapshot,snapshot_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Snapshot", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "DeleteSnapshot": { + "requestType": "DeleteSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/instances/*/snapshots/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "UpdateSnapshot": { + "requestType": "UpdateSnapshotRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}", + "(google.api.http).body": "snapshot", + "(google.api.method_signature)": "snapshot,update_mask", + "(google.longrunning.operation_info).response_type": "Snapshot", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{snapshot.name=projects/*/locations/*/instances/*/snapshots/*}", + "body": "snapshot" + } + }, + { + "(google.api.method_signature)": "snapshot,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Snapshot", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, "ListBackups": { "requestType": "ListBackupsRequest", "responseType": "ListBackupsResponse", @@ -1171,6 +1313,124 @@ } } ] + }, + "ListShares": { + "requestType": "ListSharesRequest", + "responseType": "ListSharesResponse", + "options": { + "(google.api.http).get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetShare": { + "requestType": "GetShareRequest", + "responseType": "Share", + "options": { + "(google.api.http).get": "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateShare": { + "requestType": "CreateShareRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares", + "(google.api.http).body": "share", + "(google.api.method_signature)": "parent,share,share_id", + "(google.longrunning.operation_info).response_type": "Share", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1beta1/{parent=projects/*/locations/*/instances/*}/shares", + "body": "share" + } + }, + { + "(google.api.method_signature)": "parent,share,share_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Share", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "DeleteShare": { + "requestType": "DeleteShareRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1beta1/{name=projects/*/locations/*/instances/*/shares/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] + }, + "UpdateShare": { + "requestType": "UpdateShareRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}", + "(google.api.http).body": "share", + "(google.api.method_signature)": "share,update_mask", + "(google.longrunning.operation_info).response_type": "Share", + "(google.longrunning.operation_info).metadata_type": "google.cloud.common.OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1beta1/{share.name=projects/*/locations/*/instances/*/shares/*}", + "body": "share" + } + }, + { + "(google.api.method_signature)": "share,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Share", + "metadata_type": "google.cloud.common.OperationMetadata" + } + } + ] } } }, @@ -1196,6 +1456,10 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "connectMode": { + "type": "ConnectMode", + "id": 6 } }, "nested": { @@ -1204,6 +1468,13 @@ "ADDRESS_MODE_UNSPECIFIED": 0, "MODE_IPV4": 1 } + }, + "ConnectMode": { + "values": { + "CONNECT_MODE_UNSPECIFIED": 0, + "DIRECT_PEERING": 1, + "PRIVATE_SERVICE_ACCESS": 2 + } } } }, @@ -1346,6 +1617,47 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "kmsKeyName": { + "type": "string", + "id": 14 + }, + "suspensionReasons": { + "rule": "repeated", + "type": "SuspensionReason", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maxCapacityGb": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "capacityStepSizeGb": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "maxShareCount": { + "type": "int64", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "capacityGb": { + "type": "int64", + "id": 19 + }, + "multiShareEnabled": { + "type": "bool", + "id": 20 } }, "nested": { @@ -1357,7 +1669,11 @@ "REPAIRING": 3, "DELETING": 4, "ERROR": 6, - "RESTORING": 7 + "RESTORING": 7, + "SUSPENDED": 8, + "REVERTING": 9, + "SUSPENDING": 10, + "RESUMING": 11 } }, "Tier": { @@ -1367,7 +1683,14 @@ "PREMIUM": 2, "BASIC_HDD": 3, "BASIC_SSD": 4, - "HIGH_SCALE_SSD": 6 + "HIGH_SCALE_SSD": 6, + "ENTERPRISE": 7 + } + }, + "SuspensionReason": { + "values": { + "SUSPENSION_REASON_UNSPECIFIED": 0, + "KMS_KEY_ISSUE": 1 } } } @@ -1469,6 +1792,25 @@ } } }, + "RevertInstanceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "targetSnapshotId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, "DeleteInstanceRequest": { "fields": { "name": { @@ -1478,6 +1820,10 @@ "(google.api.field_behavior)": "REQUIRED", "(google.api.resource_reference).type": "file.googleapis.com/Instance" } + }, + "force": { + "type": "bool", + "id": 2 } } }, @@ -1582,6 +1928,115 @@ } } }, + "CreateSnapshotRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "snapshotId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "snapshot": { + "type": "Snapshot", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Snapshot" + } + } + } + }, + "DeleteSnapshotRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Snapshot" + } + } + } + }, + "UpdateSnapshotRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "snapshot": { + "type": "Snapshot", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListSnapshotsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListSnapshotsResponse": { + "fields": { + "snapshots": { + "rule": "repeated", + "type": "Snapshot", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, "Backup": { "options": { "(google.api.resource).type": "file.googleapis.com/Backup", @@ -1663,6 +2118,13 @@ "options": { "(google.api.field_behavior)": "OUTPUT_ONLY" } + }, + "kmsKeyName": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } } }, "nested": { @@ -1790,6 +2252,181 @@ "id": 3 } } + }, + "Share": { + "options": { + "(google.api.resource).type": "file.googleapis.com/Share", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/instances/{instance}/shares/{share}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "mountName": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "capacityGb": { + "type": "int64", + "id": 4 + }, + "nfsExportOptions": { + "rule": "repeated", + "type": "NfsExportOptions", + "id": 5 + }, + "state": { + "type": "State", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 8 + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 3, + "DELETING": 4 + } + } + } + }, + "CreateShareRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "shareId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "share": { + "type": "Share", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetShareRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Share" + } + } + } + }, + "DeleteShareRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Share" + } + } + } + }, + "ListSharesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "file.googleapis.com/Instance" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + }, + "orderBy": { + "type": "string", + "id": 4 + }, + "filter": { + "type": "string", + "id": 5 + } + } + }, + "ListSharesResponse": { + "fields": { + "shares": { + "rule": "repeated", + "type": "Share", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "UpdateShareRequest": { + "fields": { + "share": { + "type": "Share", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } } } } diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js index aa4b06a679b..abb5ddf22ac 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js @@ -30,7 +30,7 @@ function main(parent, backup, backupId) { */ /** * Required. The backup's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Filestore, * backup locations map to GCP regions, for example **us-west1**. */ // const parent = 'abc123' diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js index 62c0b12052c..72c28fa15d7 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js @@ -30,7 +30,7 @@ function main(parent, instanceId, instance) { */ /** * Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Filestore, * locations map to GCP zones, for example **us-west1-b**. */ // const parent = 'abc123' diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js new file mode 100644 index 00000000000..320bf1674c6 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, shareId, share) { + // [START file_v1beta1_generated_CloudFilestoreManager_CreateShare_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Filestore Instance to create the share for, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the share. + * The ID must be unique within the specified instance. + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + */ + // const shareId = 'abc123' + /** + * Required. A share resource + */ + // const share = {} + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callCreateShare() { + // Construct request + const request = { + parent, + shareId, + share, + }; + + // Run request + const [operation] = await filestoreClient.createShare(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateShare(); + // [END file_v1beta1_generated_CloudFilestoreManager_CreateShare_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js new file mode 100644 index 00000000000..bd7b85e1f35 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js @@ -0,0 +1,76 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent, snapshotId, snapshot) { + // [START file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The Filestore Instance to create the snapshots of, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + */ + // const parent = 'abc123' + /** + * Required. The ID to use for the snapshot. + * The ID must be unique within the specified instance. + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + */ + // const snapshotId = 'abc123' + /** + * Required. A snapshot resource + */ + // const snapshot = {} + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callCreateSnapshot() { + // Construct request + const request = { + parent, + snapshotId, + snapshot, + }; + + // Run request + const [operation] = await filestoreClient.createSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateSnapshot(); + // [END file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js index e6ce14ab7d1..7cb623b9c6f 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js @@ -33,6 +33,11 @@ function main(name) { * `projects/{project_id}/locations/{location}/instances/{instance_id}` */ // const name = 'abc123' + /** + * If set to true, any snapshots of the instance will also be deleted. + * (Otherwise, the request will only work if the instance has no snapshots.) + */ + // const force = true // Imports the Filestore library const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js new file mode 100644 index 00000000000..ed2da9080ef --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callDeleteShare() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteShare(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteShare(); + // [END file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js new file mode 100644 index 00000000000..9481606e112 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js @@ -0,0 +1,63 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callDeleteSnapshot() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await filestoreClient.deleteSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteSnapshot(); + // [END file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js new file mode 100644 index 00000000000..010662106ef --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_GetShare_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callGetShare() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getShare(request); + console.log(response); + } + + callGetShare(); + // [END file_v1beta1_generated_CloudFilestoreManager_GetShare_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js new file mode 100644 index 00000000000..596118f4b9a --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js @@ -0,0 +1,62 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + */ + // const name = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callGetSnapshot() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await filestoreClient.getSnapshot(request); + console.log(response); + } + + callGetSnapshot(); + // [END file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js index 7869cd6805f..54a949aed56 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js @@ -31,7 +31,7 @@ function main(parent) { /** * Required. The project and location for which to retrieve backup information, * in the format `projects/{project_id}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, + * In Filestore, backup locations map to GCP regions, * for example **us-west1**. * To retrieve backup information for all locations, use "-" for the * `{location}` value. diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js new file mode 100644 index 00000000000..bea899f4914 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START file_v1beta1_generated_CloudFilestoreManager_ListShares_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance for which to retrieve share information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callListShares() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listSharesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListShares(); + // [END file_v1beta1_generated_CloudFilestoreManager_ListShares_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js new file mode 100644 index 00000000000..b09682c478e --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js @@ -0,0 +1,82 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The instance for which to retrieve snapshot information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + */ + // 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' + /** + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + */ + // const orderBy = 'abc123' + /** + * List filter. + */ + // const filter = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callListSnapshots() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = await filestoreClient.listSnapshotsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListSnapshots(); + // [END file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js index 033044f5c2b..84556de1fc4 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js @@ -34,7 +34,7 @@ function main(name, fileShare) { */ // const name = 'abc123' /** - * Required. Name of the file share in the Cloud Filestore instance that the snapshot + * Required. Name of the file share in the Filestore instance that the snapshot * is being restored to. */ // const fileShare = 'abc123' diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js new file mode 100644 index 00000000000..a3c79b8bf5d --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js @@ -0,0 +1,70 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name, targetSnapshotId) { + // [START file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}. + * The resource name of the instance, in the format + */ + // const name = 'abc123' + /** + * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified + * ID is the {snapshot_id} of the fully qualified name like + * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id} + */ + // const targetSnapshotId = 'abc123' + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callRevertInstance() { + // Construct request + const request = { + name, + targetSnapshotId, + }; + + // Run request + const [operation] = await filestoreClient.revertInstance(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRevertInstance(); + // [END file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js new file mode 100644 index 00000000000..fc3547a1b67 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js @@ -0,0 +1,74 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(share, updateMask) { + // [START file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. A share resource. + * Only fields specified in update_mask are updated. + */ + // const share = {} + /** + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * The elements of the repeated paths field may only include these fields: + * * "description" + * * "capacity_gb" + * * "labels" + * * "nfs_export_options" + */ + // const updateMask = {} + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callUpdateShare() { + // Construct request + const request = { + share, + updateMask, + }; + + // Run request + const [operation] = await filestoreClient.updateShare(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateShare(); + // [END file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js new file mode 100644 index 00000000000..215444c8e61 --- /dev/null +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js @@ -0,0 +1,68 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, snapshot) { + // [START file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + */ + // const updateMask = {} + /** + * Required. A snapshot resource + */ + // const snapshot = {} + + // Imports the Filestore library + const {CloudFilestoreManagerClient} = require('@google-cloud/filestore').v1beta1; + + // Instantiates a client + const filestoreClient = new CloudFilestoreManagerClient(); + + async function callUpdateSnapshot() { + // Construct request + const request = { + updateMask, + snapshot, + }; + + // Run request + const [operation] = await filestoreClient.updateSnapshot(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateSnapshot(); + // [END file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index 5d7947cde17..2b95f20aa25 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -251,6 +251,50 @@ } } }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async", + "title": "CloudFilestoreManager revertInstance Sample", + "origin": "API_DEFINITION", + "description": " Revert an existing instance's file system to a specified snapshot.", + "canonical": true, + "file": "cloud_filestore_manager.revert_instance.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 62, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RevertInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RevertInstance", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "target_snapshot_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "RevertInstance", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.RevertInstance", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, { "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async", "title": "CloudFilestoreManager deleteInstance Sample", @@ -262,7 +306,7 @@ "segments": [ { "start": 25, - "end": 55, + "end": 60, "type": "FULL" } ], @@ -274,6 +318,10 @@ { "name": "name", "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" } ], "resultType": ".google.longrunning.Operation", @@ -291,6 +339,234 @@ } } }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async", + "title": "CloudFilestoreManager listSnapshots Sample", + "origin": "API_DEFINITION", + "description": " Lists all snapshots in a project for either a specified location or for all locations.", + "canonical": true, + "file": "cloud_filestore_manager.list_snapshots.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListSnapshots", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSnapshots", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListSnapshotsResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListSnapshots", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListSnapshots", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async", + "title": "CloudFilestoreManager getSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific snapshot.", + "canonical": true, + "file": "cloud_filestore_manager.get_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetSnapshot", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Snapshot", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetSnapshot", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async", + "title": "CloudFilestoreManager createSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Creates a snapshot.", + "canonical": true, + "file": "cloud_filestore_manager.create_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateSnapshot", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "snapshot_id", + "type": "TYPE_STRING" + }, + { + "name": "snapshot", + "type": ".google.cloud.filestore.v1beta1.Snapshot" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateSnapshot", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async", + "title": "CloudFilestoreManager deleteSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Deletes a snapshot.", + "canonical": true, + "file": "cloud_filestore_manager.delete_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteSnapshot", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteSnapshot", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async", + "title": "CloudFilestoreManager updateSnapshot Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific snapshot.", + "canonical": true, + "file": "cloud_filestore_manager.update_snapshot.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 60, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateSnapshot", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "snapshot", + "type": ".google.cloud.filestore.v1beta1.Snapshot" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateSnapshot", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateSnapshot", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, { "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListBackups_async", "title": "CloudFilestoreManager listBackups Sample", @@ -518,6 +794,234 @@ } } } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_ListShares_async", + "title": "CloudFilestoreManager listShares Sample", + "origin": "API_DEFINITION", + "description": " Lists all shares for a specified instance.", + "canonical": true, + "file": "cloud_filestore_manager.list_shares.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListShares", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListShares", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + }, + { + "name": "order_by", + "type": "TYPE_STRING" + }, + { + "name": "filter", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.ListSharesResponse", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "ListShares", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.ListShares", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_GetShare_async", + "title": "CloudFilestoreManager getShare Sample", + "origin": "API_DEFINITION", + "description": " Gets the details of a specific share.", + "canonical": true, + "file": "cloud_filestore_manager.get_share.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetShare", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.filestore.v1beta1.Share", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "GetShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.GetShare", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_CreateShare_async", + "title": "CloudFilestoreManager createShare Sample", + "origin": "API_DEFINITION", + "description": " Creates a share.", + "canonical": true, + "file": "cloud_filestore_manager.create_share.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateShare", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "share_id", + "type": "TYPE_STRING" + }, + { + "name": "share", + "type": ".google.cloud.filestore.v1beta1.Share" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "CreateShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.CreateShare", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async", + "title": "CloudFilestoreManager deleteShare Sample", + "origin": "API_DEFINITION", + "description": " Deletes a share.", + "canonical": true, + "file": "cloud_filestore_manager.delete_share.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteShare", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "DeleteShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.DeleteShare", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } + }, + { + "regionTag": "file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async", + "title": "CloudFilestoreManager updateShare Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a specific share.", + "canonical": true, + "file": "cloud_filestore_manager.update_share.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 66, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateShare", + "async": true, + "parameters": [ + { + "name": "share", + "type": ".google.cloud.filestore.v1beta1.Share" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "CloudFilestoreManagerClient", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManagerClient" + }, + "method": { + "shortName": "UpdateShare", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager.UpdateShare", + "service": { + "shortName": "CloudFilestoreManager", + "fullName": "google.cloud.filestore.v1beta1.CloudFilestoreManager" + } + } + } } ] } \ No newline at end of file diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts index 4dd858d038c..08439527c12 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client.ts @@ -27,6 +27,8 @@ import type { LROperation, PaginationCallback, GaxCall, + LocationsClient, + LocationProtos, } from 'google-gax'; import {Transform} from 'stream'; import * as protos from '../../protos/protos'; @@ -40,17 +42,17 @@ import * as gapicConfig from './cloud_filestore_manager_client_config.json'; const version = require('../../../package.json').version; /** - * Configures and manages Cloud Filestore resources. + * Configures and manages Filestore resources. * - * Cloud Filestore Manager v1beta1. + * Filestore Manager v1beta1. * - * The `file.googleapis.com` service implements the Cloud Filestore API and + * The `file.googleapis.com` service implements the Filestore API and * defines the following model for managing resources: * * The service works with a collection of cloud projects, named: `/projects/*` * * Each project has a collection of available locations, named: `/locations/*` * * Each location has a collection of instances and backups, named: * `/instances/*` and `/backups/*` respectively. - * * As such, Cloud Filestore instances are resources of the form: + * * As such, Filestore instances are resources of the form: * `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` * backups are resources of the form: * `/projects/{project_id}/locations/{location_id}/backup/{backup_id}` @@ -82,6 +84,7 @@ export class CloudFilestoreManagerClient { }; warn: (code: string, message: string, warnType?: string) => void; innerApiCalls: {[name: string]: Function}; + locationsClient: LocationsClient; pathTemplates: {[name: string]: gax.PathTemplate}; operationsClient: gax.OperationsClient; cloudFilestoreManagerStub?: Promise<{[name: string]: Function}>; @@ -177,6 +180,10 @@ export class CloudFilestoreManagerClient { if (servicePath === staticMembers.servicePath) { this.auth.defaultScopes = staticMembers.scopes; } + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); // Determine the client header string. const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; @@ -209,6 +216,9 @@ export class CloudFilestoreManagerClient { locationPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}' ), + sharePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/instances/{instance}/shares/{share}' + ), snapshotPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/instances/{instance}/snapshots/{snapshot}' ), @@ -223,11 +233,21 @@ export class CloudFilestoreManagerClient { 'nextPageToken', 'instances' ), + listSnapshots: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'snapshots' + ), listBackups: new this._gaxModule.PageDescriptor( 'pageToken', 'nextPageToken', 'backups' ), + listShares: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'shares' + ), }; const protoFilesRoot = this._gaxModule.protobuf.Root.fromJSON(jsonProtos); @@ -289,12 +309,36 @@ export class CloudFilestoreManagerClient { const restoreInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.common.OperationMetadata' ) as gax.protobuf.Type; + const revertInstanceResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Instance' + ) as gax.protobuf.Type; + const revertInstanceMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; const deleteInstanceResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; const deleteInstanceMetadata = protoFilesRoot.lookup( '.google.cloud.common.OperationMetadata' ) as gax.protobuf.Type; + const createSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Snapshot' + ) as gax.protobuf.Type; + const createSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteSnapshotResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateSnapshotResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Snapshot' + ) as gax.protobuf.Type; + const updateSnapshotMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; const createBackupResponse = protoFilesRoot.lookup( '.google.cloud.filestore.v1beta1.Backup' ) as gax.protobuf.Type; @@ -313,6 +357,24 @@ export class CloudFilestoreManagerClient { const updateBackupMetadata = protoFilesRoot.lookup( '.google.cloud.common.OperationMetadata' ) as gax.protobuf.Type; + const createShareResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Share' + ) as gax.protobuf.Type; + const createShareMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const deleteShareResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteShareMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; + const updateShareResponse = protoFilesRoot.lookup( + '.google.cloud.filestore.v1beta1.Share' + ) as gax.protobuf.Type; + const updateShareMetadata = protoFilesRoot.lookup( + '.google.cloud.common.OperationMetadata' + ) as gax.protobuf.Type; this.descriptors.longrunning = { createInstance: new this._gaxModule.LongrunningDescriptor( @@ -330,11 +392,31 @@ export class CloudFilestoreManagerClient { restoreInstanceResponse.decode.bind(restoreInstanceResponse), restoreInstanceMetadata.decode.bind(restoreInstanceMetadata) ), + revertInstance: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + revertInstanceResponse.decode.bind(revertInstanceResponse), + revertInstanceMetadata.decode.bind(revertInstanceMetadata) + ), deleteInstance: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteInstanceResponse.decode.bind(deleteInstanceResponse), deleteInstanceMetadata.decode.bind(deleteInstanceMetadata) ), + createSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createSnapshotResponse.decode.bind(createSnapshotResponse), + createSnapshotMetadata.decode.bind(createSnapshotMetadata) + ), + deleteSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteSnapshotResponse.decode.bind(deleteSnapshotResponse), + deleteSnapshotMetadata.decode.bind(deleteSnapshotMetadata) + ), + updateSnapshot: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateSnapshotResponse.decode.bind(updateSnapshotResponse), + updateSnapshotMetadata.decode.bind(updateSnapshotMetadata) + ), createBackup: new this._gaxModule.LongrunningDescriptor( this.operationsClient, createBackupResponse.decode.bind(createBackupResponse), @@ -350,6 +432,21 @@ export class CloudFilestoreManagerClient { updateBackupResponse.decode.bind(updateBackupResponse), updateBackupMetadata.decode.bind(updateBackupMetadata) ), + createShare: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createShareResponse.decode.bind(createShareResponse), + createShareMetadata.decode.bind(createShareMetadata) + ), + deleteShare: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteShareResponse.decode.bind(deleteShareResponse), + deleteShareMetadata.decode.bind(deleteShareMetadata) + ), + updateShare: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateShareResponse.decode.bind(updateShareResponse), + updateShareMetadata.decode.bind(updateShareMetadata) + ), }; // Put together the default options sent with requests. @@ -408,12 +505,23 @@ export class CloudFilestoreManagerClient { 'createInstance', 'updateInstance', 'restoreInstance', + 'revertInstance', 'deleteInstance', + 'listSnapshots', + 'getSnapshot', + 'createSnapshot', + 'deleteSnapshot', + 'updateSnapshot', 'listBackups', 'getBackup', 'createBackup', 'deleteBackup', 'updateBackup', + 'listShares', + 'getShare', + 'createShare', + 'deleteShare', + 'updateShare', ]; for (const methodName of cloudFilestoreManagerStubMethods) { const callPromise = this.cloudFilestoreManagerStub.then( @@ -592,6 +700,98 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.innerApiCalls.getInstance(request, options, callback); } + /** + * Gets the details of a specific snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Snapshot]{@link google.cloud.filestore.v1beta1.Snapshot}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_GetSnapshot_async + */ + getSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest | undefined, + {} | undefined + ] + >; + getSnapshot( + request: protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1beta1.ISnapshot, + | protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSnapshot( + request: protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest, + callback: Callback< + protos.google.cloud.filestore.v1beta1.ISnapshot, + | protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1beta1.ISnapshot, + | protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1beta1.ISnapshot, + | protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.filestore.v1beta1.IGetSnapshotRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getSnapshot(request, options, callback); + } /** * Gets the details of a specific backup. * @@ -684,6 +884,92 @@ export class CloudFilestoreManagerClient { this.initialize(); return this.innerApiCalls.getBackup(request, options, callback); } + /** + * Gets the details of a specific share. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/shares/{share_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Share]{@link google.cloud.filestore.v1beta1.Share}. + * 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/cloud_filestore_manager.get_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_GetShare_async + */ + getShare( + request?: protos.google.cloud.filestore.v1beta1.IGetShareRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.filestore.v1beta1.IGetShareRequest | undefined, + {} | undefined + ] + >; + getShare( + request: protos.google.cloud.filestore.v1beta1.IGetShareRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.filestore.v1beta1.IGetShareRequest | null | undefined, + {} | null | undefined + > + ): void; + getShare( + request: protos.google.cloud.filestore.v1beta1.IGetShareRequest, + callback: Callback< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.filestore.v1beta1.IGetShareRequest | null | undefined, + {} | null | undefined + > + ): void; + getShare( + request?: protos.google.cloud.filestore.v1beta1.IGetShareRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.filestore.v1beta1.IShare, + | protos.google.cloud.filestore.v1beta1.IGetShareRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.filestore.v1beta1.IGetShareRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.filestore.v1beta1.IGetShareRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.getShare(request, options, callback); + } /** * Creates an instance. @@ -695,7 +981,7 @@ export class CloudFilestoreManagerClient { * The request object that will be sent. * @param {string} request.parent * Required. The instance's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, + * `projects/{project_id}/locations/{location}`. In Filestore, * locations map to GCP zones, for example **us-west1-b**. * @param {string} request.instanceId * Required. The ID of the instance to create. @@ -995,7 +1281,7 @@ export class CloudFilestoreManagerClient { * Required. The resource name of the instance, in the format * `projects/{project_id}/locations/{location_id}/instances/{instance_id}`. * @param {string} request.fileShare - * Required. Name of the file share in the Cloud Filestore instance that the snapshot + * Required. Name of the file share in the Filestore instance that the snapshot * is being restored to. * @param {string} request.sourceSnapshot * The resource name of the snapshot, in the format @@ -1135,13 +1421,17 @@ export class CloudFilestoreManagerClient { >; } /** - * Deletes an instance. + * Revert an existing instance's file system to a specified snapshot. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The instance resource name, in the format - * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * Required. projects/{project_id}/locations/{location_id}/instances/{instance_id}. + * The resource name of the instance, in the format + * @param {string} request.targetSnapshotId + * Required. The snapshot resource ID, in the format 'my-snapshot', where the specified + * ID is the {snapshot_id} of the fully qualified name like + * projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id} * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1151,52 +1441,52 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_instance.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async */ - deleteInstance( - request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + revertInstance( + request?: protos.google.cloud.filestore.v1beta1.IRevertInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - deleteInstance( - request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + revertInstance( + request: protos.google.cloud.filestore.v1beta1.IRevertInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + revertInstance( + request: protos.google.cloud.filestore.v1beta1.IRevertInstanceRequest, callback: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - deleteInstance( - request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, + revertInstance( + request?: protos.google.cloud.filestore.v1beta1.IRevertInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1204,7 +1494,7 @@ export class CloudFilestoreManagerClient { >, callback?: Callback< LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1213,7 +1503,7 @@ export class CloudFilestoreManagerClient { ): Promise< [ LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1236,10 +1526,10 @@ export class CloudFilestoreManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteInstance(request, options, callback); + return this.innerApiCalls.revertInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteInstance()`. + * Check the status of the long running operation returned by `revertInstance()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1247,14 +1537,14 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_instance.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_RevertInstance_async */ - async checkDeleteInstanceProgress( + async checkRevertInstanceProgress( name: string ): Promise< LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.filestore.v1beta1.Instance, protos.google.cloud.common.OperationMetadata > > { @@ -1265,31 +1555,25 @@ export class CloudFilestoreManagerClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteInstance, + this.descriptors.longrunning.revertInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.protobuf.Empty, + protos.google.cloud.filestore.v1beta1.Instance, protos.google.cloud.common.OperationMetadata >; } /** - * Creates a backup. + * Deletes an instance. * * @param {Object} request * The request object that will be sent. - * @param {string} request.parent - * Required. The backup's project and location, in the format - * `projects/{project_id}/locations/{location}`. In Cloud Filestore, - * backup locations map to GCP regions, for example **us-west1**. - * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} - * @param {string} request.backupId - * Required. The ID to use for the backup. - * The ID must be unique within the specified project and location. - * - * This value must start with a lowercase letter followed by up to 62 - * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @param {string} request.name + * Required. The instance resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param {boolean} request.force + * If set to true, any snapshots of the instance will also be deleted. + * (Otherwise, the request will only work if the instance has no snapshots.) * @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. @@ -1299,52 +1583,52 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.create_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async */ - createBackup( - request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + deleteInstance( + request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - createBackup( - request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + deleteInstance( + request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createBackup( - request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + deleteInstance( + request: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, callback: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - createBackup( - request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + deleteInstance( + request?: protos.google.cloud.filestore.v1beta1.IDeleteInstanceRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1352,7 +1636,7 @@ export class CloudFilestoreManagerClient { >, callback?: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1361,7 +1645,7 @@ export class CloudFilestoreManagerClient { ): Promise< [ LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1381,13 +1665,13 @@ export class CloudFilestoreManagerClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - parent: request.parent ?? '', + name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.createBackup(request, options, callback); + return this.innerApiCalls.deleteInstance(request, options, callback); } /** - * Check the status of the long running operation returned by `createBackup()`. + * 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. @@ -1395,14 +1679,14 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.create_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteInstance_async */ - async checkCreateBackupProgress( + async checkDeleteInstanceProgress( name: string ): Promise< LROperation< - protos.google.cloud.filestore.v1beta1.Backup, + protos.google.protobuf.Empty, protos.google.cloud.common.OperationMetadata > > { @@ -1413,22 +1697,169 @@ export class CloudFilestoreManagerClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.createBackup, + this.descriptors.longrunning.deleteInstance, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.filestore.v1beta1.Backup, + protos.google.protobuf.Empty, protos.google.cloud.common.OperationMetadata >; } /** - * Deletes a backup. + * Creates a snapshot. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Filestore Instance to create the snapshots of, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param {string} request.snapshotId + * Required. The ID to use for the snapshot. + * The ID must be unique within the specified instance. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @param {google.cloud.filestore.v1beta1.Snapshot} request.snapshot + * Required. A snapshot 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/cloud_filestore_manager.create_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async + */ + createSnapshot( + request?: protos.google.cloud.filestore.v1beta1.ICreateSnapshotRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createSnapshot( + request: protos.google.cloud.filestore.v1beta1.ICreateSnapshotRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSnapshot( + request: protos.google.cloud.filestore.v1beta1.ICreateSnapshotRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createSnapshot( + request?: protos.google.cloud.filestore.v1beta1.ICreateSnapshotRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createSnapshot(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createSnapshot()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateSnapshot_async + */ + async checkCreateSnapshotProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Snapshot, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createSnapshot, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Snapshot, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Deletes a snapshot. * * @param {Object} request * The request object that will be sent. * @param {string} request.name - * Required. The backup resource name, in the format - * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * Required. The snapshot resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/snapshots/{snapshot_id}` * @param {object} [options] * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. * @returns {Promise} - The promise which resolves to an array. @@ -1438,11 +1869,11 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async */ - deleteBackup( - request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + deleteSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, options?: CallOptions ): Promise< [ @@ -1454,8 +1885,8 @@ export class CloudFilestoreManagerClient { {} | undefined ] >; - deleteBackup( - request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + deleteSnapshot( + request: protos.google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, options: CallOptions, callback: Callback< LROperation< @@ -1466,8 +1897,8 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - deleteBackup( - request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + deleteSnapshot( + request: protos.google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, callback: Callback< LROperation< protos.google.protobuf.IEmpty, @@ -1477,8 +1908,8 @@ export class CloudFilestoreManagerClient { {} | null | undefined > ): void; - deleteBackup( - request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + deleteSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IDeleteSnapshotRequest, optionsOrCallback?: | CallOptions | Callback< @@ -1523,10 +1954,10 @@ export class CloudFilestoreManagerClient { name: request.name ?? '', }); this.initialize(); - return this.innerApiCalls.deleteBackup(request, options, callback); + return this.innerApiCalls.deleteSnapshot(request, options, callback); } /** - * Check the status of the long running operation returned by `deleteBackup()`. + * Check the status of the long running operation returned by `deleteSnapshot()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1534,10 +1965,10 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.delete_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteSnapshot_async */ - async checkDeleteBackupProgress( + async checkDeleteSnapshotProgress( name: string ): Promise< LROperation< @@ -1552,7 +1983,7 @@ export class CloudFilestoreManagerClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.deleteBackup, + this.descriptors.longrunning.deleteSnapshot, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< @@ -1561,15 +1992,15 @@ export class CloudFilestoreManagerClient { >; } /** - * Updates the settings of a specific backup. + * Updates the settings of a specific snapshot. * * @param {Object} request * The request object that will be sent. - * @param {google.cloud.filestore.v1beta1.Backup} request.backup - * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} * @param {google.protobuf.FieldMask} request.updateMask * Required. Mask of fields to update. At least one path must be supplied in this * field. + * @param {google.cloud.filestore.v1beta1.Snapshot} request.snapshot + * Required. A snapshot 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. @@ -1579,52 +2010,52 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.update_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async */ - updateBackup( - request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + updateSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, options?: CallOptions ): Promise< [ LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, {} | undefined ] >; - updateBackup( - request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + updateSnapshot( + request: protos.google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, options: CallOptions, callback: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateBackup( - request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + updateSnapshot( + request: protos.google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, callback: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, {} | null | undefined > ): void; - updateBackup( - request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + updateSnapshot( + request?: protos.google.cloud.filestore.v1beta1.IUpdateSnapshotRequest, optionsOrCallback?: | CallOptions | Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1632,7 +2063,7 @@ export class CloudFilestoreManagerClient { >, callback?: Callback< LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | null | undefined, @@ -1641,7 +2072,7 @@ export class CloudFilestoreManagerClient { ): Promise< [ LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >, protos.google.longrunning.IOperation | undefined, @@ -1661,13 +2092,13 @@ export class CloudFilestoreManagerClient { options.otherArgs.headers = options.otherArgs.headers || {}; options.otherArgs.headers['x-goog-request-params'] = this._gaxModule.routingHeader.fromParams({ - 'backup.name': request.backup!.name ?? '', + 'snapshot.name': request.snapshot!.name ?? '', }); this.initialize(); - return this.innerApiCalls.updateBackup(request, options, callback); + return this.innerApiCalls.updateSnapshot(request, options, callback); } /** - * Check the status of the long running operation returned by `updateBackup()`. + * Check the status of the long running operation returned by `updateSnapshot()`. * @param {String} name * The operation name that will be passed. * @returns {Promise} - The promise which resolves to an object. @@ -1675,14 +2106,14 @@ export class CloudFilestoreManagerClient { * 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/cloud_filestore_manager.update_backup.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateSnapshot_async */ - async checkUpdateBackupProgress( + async checkUpdateSnapshotProgress( name: string ): Promise< LROperation< - protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.filestore.v1beta1.Snapshot, protos.google.cloud.common.OperationMetadata > > { @@ -1693,102 +2124,1393 @@ export class CloudFilestoreManagerClient { const [operation] = await this.operationsClient.getOperation(request); const decodeOperation = new this._gaxModule.Operation( operation, - this.descriptors.longrunning.updateBackup, + this.descriptors.longrunning.updateSnapshot, this._gaxModule.createDefaultBackoffSettings() ); return decodeOperation as LROperation< - protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.filestore.v1beta1.Snapshot, protos.google.cloud.common.OperationMetadata >; } /** - * Lists all instances in a project for either a specified location - * or for all locations. + * Creates a backup. * * @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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the - * `{location}` value. - * @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.orderBy - * Sort results. Supported values are "name", "name desc" or "" (unsorted). - * @param {string} request.filter - * List filter. + * Required. The backup's project and location, in the format + * `projects/{project_id}/locations/{location}`. In Filestore, + * backup locations map to GCP regions, for example **us-west1**. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} + * @param {string} request.backupId + * Required. The ID to use for the backup. + * The ID must be unique within the specified project and location. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. * @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.filestore.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. + * 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#auto-pagination) + * [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/cloud_filestore_manager.create_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async */ - listInstances( - request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + createBackup( + request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.filestore.v1beta1.IInstance[], - protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, - protos.google.cloud.filestore.v1beta1.IListInstancesResponse + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined ] >; - listInstances( - request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + createBackup( + request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IInstance + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined > ): void; - listInstances( - request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse - | null - | undefined, - protos.google.cloud.filestore.v1beta1.IInstance + createBackup( + request: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createBackup( + request?: protos.google.cloud.filestore.v1beta1.ICreateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.create_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateBackup_async + */ + async checkCreateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Deletes a backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The backup resource name, in the format + * `projects/{project_id}/locations/{location}/backups/{backup_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteBackup( + request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteBackup( + request?: protos.google.cloud.filestore.v1beta1.IDeleteBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteBackup_async + */ + async checkDeleteBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Updates the settings of a specific backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1beta1.Backup} request.backup + * Required. A {@link google.cloud.filestore.v1beta1.Backup|backup resource} + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * @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/cloud_filestore_manager.update_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateBackup( + request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateBackup( + request?: protos.google.cloud.filestore.v1beta1.IUpdateBackupRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'backup.name': request.backup!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateBackup(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateBackup()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.update_backup.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateBackup_async + */ + async checkUpdateBackupProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateBackup, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Backup, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Creates a share. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The Filestore Instance to create the share for, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}` + * @param {string} request.shareId + * Required. The ID to use for the share. + * The ID must be unique within the specified instance. + * + * This value must start with a lowercase letter followed by up to 62 + * lowercase letters, numbers, or hyphens, and cannot end with a hyphen. + * @param {google.cloud.filestore.v1beta1.Share} request.share + * Required. A share 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/cloud_filestore_manager.create_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateShare_async + */ + createShare( + request?: protos.google.cloud.filestore.v1beta1.ICreateShareRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createShare( + request: protos.google.cloud.filestore.v1beta1.ICreateShareRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createShare( + request: protos.google.cloud.filestore.v1beta1.ICreateShareRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createShare( + request?: protos.google.cloud.filestore.v1beta1.ICreateShareRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.createShare(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createShare()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.create_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_CreateShare_async + */ + async checkCreateShareProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Share, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.createShare, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Share, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Deletes a share. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The share resource name, in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}/share/{share_id}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async + */ + deleteShare( + request?: protos.google.cloud.filestore.v1beta1.IDeleteShareRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteShare( + request: protos.google.cloud.filestore.v1beta1.IDeleteShareRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteShare( + request: protos.google.cloud.filestore.v1beta1.IDeleteShareRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteShare( + request?: protos.google.cloud.filestore.v1beta1.IDeleteShareRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.deleteShare(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteShare()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.delete_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_DeleteShare_async + */ + async checkDeleteShareProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.deleteShare, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Updates the settings of a specific share. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.filestore.v1beta1.Share} request.share + * Required. A share resource. + * Only fields specified in update_mask are updated. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Mask of fields to update. At least one path must be supplied in this + * field. + * The elements of the repeated paths field may only include these fields: + * + * * "description" + * * "capacity_gb" + * * "labels" + * * "nfs_export_options" + * @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/cloud_filestore_manager.update_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async + */ + updateShare( + request?: protos.google.cloud.filestore.v1beta1.IUpdateShareRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateShare( + request: protos.google.cloud.filestore.v1beta1.IUpdateShareRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateShare( + request: protos.google.cloud.filestore.v1beta1.IUpdateShareRequest, + callback: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateShare( + request?: protos.google.cloud.filestore.v1beta1.IUpdateShareRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + 'share.name': request.share!.name ?? '', + }); + this.initialize(); + return this.innerApiCalls.updateShare(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateShare()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.update_share.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_UpdateShare_async + */ + async checkUpdateShareProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.filestore.v1beta1.Share, + protos.google.cloud.common.OperationMetadata + > + > { + const request = + new this._gaxModule.operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new this._gaxModule.Operation( + operation, + this.descriptors.longrunning.updateShare, + this._gaxModule.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.filestore.v1beta1.Share, + protos.google.cloud.common.OperationMetadata + >; + } + /** + * Lists all instances in a project for either a specified location + * or for all locations. + * + * @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_id}/locations/{location}`. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the + * `{location}` value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.v1beta1.IListInstancesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance[], + protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, + protos.google.cloud.filestore.v1beta1.IListInstancesResponse + ] + >; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; + listInstances( + request: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): void; + listInstances( + request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IInstance + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IInstance[], + protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, + protos.google.cloud.filestore.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'] = + this._gaxModule.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 + * Required. The project and location for which to retrieve instance information, + * in the format `projects/{project_id}/locations/{location}`. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the + * `{location}` value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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.filestore.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'] = + this._gaxModule.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 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 + * Required. The project and location for which to retrieve instance information, + * in the format `projects/{project_id}/locations/{location}`. In Cloud + * Filestore, locations map to GCP zones, for example **us-west1-b**. To + * retrieve instance information for all locations, use "-" for the + * `{location}` value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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.filestore.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 include:samples/generated/v1beta1/cloud_filestore_manager.list_instances.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListInstances_async + */ + listInstancesAsync( + request?: protos.google.cloud.filestore.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'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + 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 {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all snapshots in a project for either a specified location + * or for all locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The instance for which to retrieve snapshot information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Snapshot]{@link google.cloud.filestore.v1beta1.Snapshot}. + * 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 `listSnapshotsAsync()` + * 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. + */ + listSnapshots( + request?: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.ISnapshot[], + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest | null, + protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse + ] + >; + listSnapshots( + request: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + | protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.ISnapshot > ): void; - listInstances( - request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + listSnapshots( + request: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + | protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.ISnapshot + > + ): void; + listSnapshots( + request?: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + | protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IInstance + protos.google.cloud.filestore.v1beta1.ISnapshot >, callback?: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListInstancesRequest, - | protos.google.cloud.filestore.v1beta1.IListInstancesResponse + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + | protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IInstance + protos.google.cloud.filestore.v1beta1.ISnapshot > ): Promise< [ - protos.google.cloud.filestore.v1beta1.IInstance[], - protos.google.cloud.filestore.v1beta1.IListInstancesRequest | null, - protos.google.cloud.filestore.v1beta1.IListInstancesResponse + protos.google.cloud.filestore.v1beta1.ISnapshot[], + protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest | null, + protos.google.cloud.filestore.v1beta1.IListSnapshotsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + this.initialize(); + return this.innerApiCalls.listSnapshots(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 for which to retrieve snapshot information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Snapshot]{@link google.cloud.filestore.v1beta1.Snapshot} 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 `listSnapshotsAsync()` + * 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. + */ + listSnapshotsStream( + request?: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSnapshots.createStream( + this.innerApiCalls.listSnapshots as GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSnapshots`, 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 for which to retrieve snapshot information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 + * [Snapshot]{@link google.cloud.filestore.v1beta1.Snapshot}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListSnapshots_async + */ + listSnapshotsAsync( + request?: protos.google.cloud.filestore.v1beta1.IListSnapshotsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + parent: request.parent ?? '', + }); + const defaultCallSettings = this._defaults['listSnapshots']; + const callSettings = defaultCallSettings.merge(options); + this.initialize(); + return this.descriptors.page.listSnapshots.asyncIterate( + this.innerApiCalls['listSnapshots'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists all backups in a project for either a specified location or for all + * locations. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup information, + * in the format `projects/{project_id}/locations/{location}`. + * In Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the + * `{location}` value. + * @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.orderBy + * Sort results. Supported values are "name", "name desc" or "" (unsorted). + * @param {string} request.filter + * List filter. + * @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 [Backup]{@link google.cloud.filestore.v1beta1.Backup}. + * 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 `listBackupsAsync()` + * 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. + */ + listBackups( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup[], + protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1beta1.IListBackupsResponse + ] + >; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; + listBackups( + request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): void; + listBackups( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + >, + callback?: PaginationCallback< + protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + | null + | undefined, + protos.google.cloud.filestore.v1beta1.IBackup + > + ): Promise< + [ + protos.google.cloud.filestore.v1beta1.IBackup[], + protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, + protos.google.cloud.filestore.v1beta1.IListBackupsResponse ] > | void { request = request || {}; @@ -1807,7 +3529,7 @@ export class CloudFilestoreManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listInstances(request, options, callback); + return this.innerApiCalls.listBackups(request, options, callback); } /** @@ -1815,10 +3537,11 @@ export class CloudFilestoreManagerClient { * @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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup information, + * in the format `projects/{project_id}/locations/{location}`. + * In Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. @@ -1832,17 +3555,17 @@ export class CloudFilestoreManagerClient { * @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.filestore.v1beta1.Instance} on 'data' event. + * An object stream which emits an object representing [Backup]{@link google.cloud.filestore.v1beta1.Backup} 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()` + * We recommend using `listBackupsAsync()` * 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.filestore.v1beta1.IListInstancesRequest, + listBackupsStream( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, options?: CallOptions ): Transform { request = request || {}; @@ -1853,27 +3576,28 @@ export class CloudFilestoreManagerClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listInstances']; + const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listInstances.createStream( - this.innerApiCalls.listInstances as GaxCall, + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, request, callSettings ); } /** - * Equivalent to `listInstances`, but returns an iterable object. + * Equivalent to `listBackups`, 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_id}/locations/{location}`. In Cloud - * Filestore, locations map to GCP zones, for example **us-west1-b**. To - * retrieve instance information for all locations, use "-" for the + * Required. The project and location for which to retrieve backup information, + * in the format `projects/{project_id}/locations/{location}`. + * In Filestore, backup locations map to GCP regions, + * for example **us-west1**. + * To retrieve backup information for all locations, use "-" for the * `{location}` value. * @param {number} request.pageSize * The maximum number of items to return. @@ -1889,18 +3613,18 @@ export class CloudFilestoreManagerClient { * @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.filestore.v1beta1.Instance}. The API will be called under the hood as needed, once per the page, + * [Backup]{@link google.cloud.filestore.v1beta1.Backup}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_instances.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListInstances_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_backups.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListBackups_async */ - listInstancesAsync( - request?: protos.google.cloud.filestore.v1beta1.IListInstancesRequest, + listBackupsAsync( + request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -1909,28 +3633,24 @@ export class CloudFilestoreManagerClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listInstances']; + const defaultCallSettings = this._defaults['listBackups']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listInstances.asyncIterate( - this.innerApiCalls['listInstances'] as GaxCall, + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; } /** - * Lists all backups in a project for either a specified location or for all - * locations. + * Lists all shares for a specified instance. * * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_id}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the - * `{location}` value. + * Required. The instance for which to retrieve share information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -1943,70 +3663,70 @@ export class CloudFilestoreManagerClient { * @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 [Backup]{@link google.cloud.filestore.v1beta1.Backup}. + * The first element of the array is Array of [Share]{@link google.cloud.filestore.v1beta1.Share}. * 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 `listBackupsAsync()` + * We recommend using `listSharesAsync()` * 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. */ - listBackups( - request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listShares( + request?: protos.google.cloud.filestore.v1beta1.IListSharesRequest, options?: CallOptions ): Promise< [ - protos.google.cloud.filestore.v1beta1.IBackup[], - protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, - protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IShare[], + protos.google.cloud.filestore.v1beta1.IListSharesRequest | null, + protos.google.cloud.filestore.v1beta1.IListSharesResponse ] >; - listBackups( - request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listShares( + request: protos.google.cloud.filestore.v1beta1.IListSharesRequest, options: CallOptions, callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IListSharesRequest, + | protos.google.cloud.filestore.v1beta1.IListSharesResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IBackup + protos.google.cloud.filestore.v1beta1.IShare > ): void; - listBackups( - request: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listShares( + request: protos.google.cloud.filestore.v1beta1.IListSharesRequest, callback: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IListSharesRequest, + | protos.google.cloud.filestore.v1beta1.IListSharesResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IBackup + protos.google.cloud.filestore.v1beta1.IShare > ): void; - listBackups( - request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listShares( + request?: protos.google.cloud.filestore.v1beta1.IListSharesRequest, optionsOrCallback?: | CallOptions | PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IListSharesRequest, + | protos.google.cloud.filestore.v1beta1.IListSharesResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IBackup + protos.google.cloud.filestore.v1beta1.IShare >, callback?: PaginationCallback< - protos.google.cloud.filestore.v1beta1.IListBackupsRequest, - | protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IListSharesRequest, + | protos.google.cloud.filestore.v1beta1.IListSharesResponse | null | undefined, - protos.google.cloud.filestore.v1beta1.IBackup + protos.google.cloud.filestore.v1beta1.IShare > ): Promise< [ - protos.google.cloud.filestore.v1beta1.IBackup[], - protos.google.cloud.filestore.v1beta1.IListBackupsRequest | null, - protos.google.cloud.filestore.v1beta1.IListBackupsResponse + protos.google.cloud.filestore.v1beta1.IShare[], + protos.google.cloud.filestore.v1beta1.IListSharesRequest | null, + protos.google.cloud.filestore.v1beta1.IListSharesResponse ] > | void { request = request || {}; @@ -2025,7 +3745,7 @@ export class CloudFilestoreManagerClient { parent: request.parent ?? '', }); this.initialize(); - return this.innerApiCalls.listBackups(request, options, callback); + return this.innerApiCalls.listShares(request, options, callback); } /** @@ -2033,12 +3753,9 @@ export class CloudFilestoreManagerClient { * @param {Object} request * The request object that will be sent. * @param {string} request.parent - * Required. The project and location for which to retrieve backup information, - * in the format `projects/{project_id}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the - * `{location}` value. + * Required. The instance for which to retrieve share information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2051,17 +3768,17 @@ export class CloudFilestoreManagerClient { * @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 [Backup]{@link google.cloud.filestore.v1beta1.Backup} on 'data' event. + * An object stream which emits an object representing [Share]{@link google.cloud.filestore.v1beta1.Share} 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 `listBackupsAsync()` + * We recommend using `listSharesAsync()` * 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. */ - listBackupsStream( - request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listSharesStream( + request?: protos.google.cloud.filestore.v1beta1.IListSharesRequest, options?: CallOptions ): Transform { request = request || {}; @@ -2072,29 +3789,26 @@ export class CloudFilestoreManagerClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listBackups']; + const defaultCallSettings = this._defaults['listShares']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, + return this.descriptors.page.listShares.createStream( + this.innerApiCalls.listShares as GaxCall, request, callSettings ); } /** - * Equivalent to `listBackups`, but returns an iterable object. + * Equivalent to `listShares`, 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 backup information, - * in the format `projects/{project_id}/locations/{location}`. - * In Cloud Filestore, backup locations map to GCP regions, - * for example **us-west1**. - * To retrieve backup information for all locations, use "-" for the - * `{location}` value. + * Required. The instance for which to retrieve share information, + * in the format + * `projects/{project_id}/locations/{location}/instances/{instance_id}`. * @param {number} request.pageSize * The maximum number of items to return. * @param {string} request.pageToken @@ -2109,18 +3823,18 @@ export class CloudFilestoreManagerClient { * @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 - * [Backup]{@link google.cloud.filestore.v1beta1.Backup}. The API will be called under the hood as needed, once per the page, + * [Share]{@link google.cloud.filestore.v1beta1.Share}. The API will be called under the hood as needed, once per the page, * so you can stop the iteration when you don't need more results. * Please see the * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) * for more details and examples. - * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_backups.js - * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListBackups_async + * @example include:samples/generated/v1beta1/cloud_filestore_manager.list_shares.js + * region_tag:file_v1beta1_generated_CloudFilestoreManager_ListShares_async */ - listBackupsAsync( - request?: protos.google.cloud.filestore.v1beta1.IListBackupsRequest, + listSharesAsync( + request?: protos.google.cloud.filestore.v1beta1.IListSharesRequest, options?: CallOptions - ): AsyncIterable { + ): AsyncIterable { request = request || {}; options = options || {}; options.otherArgs = options.otherArgs || {}; @@ -2129,15 +3843,272 @@ export class CloudFilestoreManagerClient { this._gaxModule.routingHeader.fromParams({ parent: request.parent ?? '', }); - const defaultCallSettings = this._defaults['listBackups']; + const defaultCallSettings = this._defaults['listShares']; const callSettings = defaultCallSettings.merge(options); this.initialize(); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, + return this.descriptors.page.listShares.asyncIterate( + this.innerApiCalls['listShares'] as GaxCall, request as {}, callSettings - ) as AsyncIterable; + ) as AsyncIterable; + } + /** + * Gets information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Location]{@link google.cloud.location.Location}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + + /** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Location]{@link google.cloud.location.Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + /** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * [google.longrunning.Operation]{@link + * external:"google.longrunning.Operation"}. The promise has a method named + * "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + return this.operationsClient.listOperationsAsync(request, options); } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.CancelOperationRequest, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See [gax.CallOptions]{@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + options?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + return this.operationsClient.deleteOperation(request, options, callback); + } + // -------------------- // -- Path templates -- // -------------------- @@ -2276,6 +4247,73 @@ export class CloudFilestoreManagerClient { return this.pathTemplates.locationPathTemplate.match(locationName).location; } + /** + * Return a fully-qualified share resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} instance + * @param {string} share + * @returns {string} Resource name string. + */ + sharePath( + project: string, + location: string, + instance: string, + share: string + ) { + return this.pathTemplates.sharePathTemplate.render({ + project: project, + location: location, + instance: instance, + share: share, + }); + } + + /** + * Parse the project from Share resource. + * + * @param {string} shareName + * A fully-qualified path representing Share resource. + * @returns {string} A string representing the project. + */ + matchProjectFromShareName(shareName: string) { + return this.pathTemplates.sharePathTemplate.match(shareName).project; + } + + /** + * Parse the location from Share resource. + * + * @param {string} shareName + * A fully-qualified path representing Share resource. + * @returns {string} A string representing the location. + */ + matchLocationFromShareName(shareName: string) { + return this.pathTemplates.sharePathTemplate.match(shareName).location; + } + + /** + * Parse the instance from Share resource. + * + * @param {string} shareName + * A fully-qualified path representing Share resource. + * @returns {string} A string representing the instance. + */ + matchInstanceFromShareName(shareName: string) { + return this.pathTemplates.sharePathTemplate.match(shareName).instance; + } + + /** + * Parse the share from Share resource. + * + * @param {string} shareName + * A fully-qualified path representing Share resource. + * @returns {string} A string representing the share. + */ + matchShareFromShareName(shareName: string) { + return this.pathTemplates.sharePathTemplate.match(shareName).share; + } + /** * Return a fully-qualified snapshot resource name string. * @@ -2354,6 +4392,7 @@ export class CloudFilestoreManagerClient { return this.cloudFilestoreManagerStub.then(stub => { this._terminated = true; stub.close(); + this.locationsClient.close(); this.operationsClient.close(); }); } diff --git a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json index 628a32b92d9..75720e2e62b 100644 --- a/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json +++ b/packages/google-cloud-filestore/src/v1beta1/cloud_filestore_manager_client_config.json @@ -57,11 +57,39 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "RevertInstance": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "DeleteInstance": { "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" }, + "ListSnapshots": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "9442ca297df43f7314712e1a19d003838e738a45" + }, + "GetSnapshot": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateSnapshot": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteSnapshot": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateSnapshot": { + "timeout_millis": 600000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, "ListBackups": { "timeout_millis": 60000, "retry_codes_name": "unavailable", @@ -86,6 +114,26 @@ "timeout_millis": 600000, "retry_codes_name": "non_idempotent", "retry_params_name": "default" + }, + "ListShares": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetShare": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateShare": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteShare": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateShare": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" } } } diff --git a/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json b/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json index efd3287373f..8ce90538169 100644 --- a/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json +++ b/packages/google-cloud-filestore/src/v1beta1/gapic_metadata.json @@ -15,11 +15,21 @@ "getInstance" ] }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, "GetBackup": { "methods": [ "getBackup" ] }, + "GetShare": { + "methods": [ + "getShare" + ] + }, "CreateInstance": { "methods": [ "createInstance" @@ -35,11 +45,31 @@ "restoreInstance" ] }, + "RevertInstance": { + "methods": [ + "revertInstance" + ] + }, "DeleteInstance": { "methods": [ "deleteInstance" ] }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "UpdateSnapshot": { + "methods": [ + "updateSnapshot" + ] + }, "CreateBackup": { "methods": [ "createBackup" @@ -55,6 +85,21 @@ "updateBackup" ] }, + "CreateShare": { + "methods": [ + "createShare" + ] + }, + "DeleteShare": { + "methods": [ + "deleteShare" + ] + }, + "UpdateShare": { + "methods": [ + "updateShare" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -62,12 +107,26 @@ "listInstancesAsync" ] }, + "ListSnapshots": { + "methods": [ + "listSnapshots", + "listSnapshotsStream", + "listSnapshotsAsync" + ] + }, "ListBackups": { "methods": [ "listBackups", "listBackupsStream", "listBackupsAsync" ] + }, + "ListShares": { + "methods": [ + "listShares", + "listSharesStream", + "listSharesAsync" + ] } } }, @@ -79,11 +138,21 @@ "getInstance" ] }, + "GetSnapshot": { + "methods": [ + "getSnapshot" + ] + }, "GetBackup": { "methods": [ "getBackup" ] }, + "GetShare": { + "methods": [ + "getShare" + ] + }, "CreateInstance": { "methods": [ "createInstance" @@ -99,11 +168,31 @@ "restoreInstance" ] }, + "RevertInstance": { + "methods": [ + "revertInstance" + ] + }, "DeleteInstance": { "methods": [ "deleteInstance" ] }, + "CreateSnapshot": { + "methods": [ + "createSnapshot" + ] + }, + "DeleteSnapshot": { + "methods": [ + "deleteSnapshot" + ] + }, + "UpdateSnapshot": { + "methods": [ + "updateSnapshot" + ] + }, "CreateBackup": { "methods": [ "createBackup" @@ -119,6 +208,21 @@ "updateBackup" ] }, + "CreateShare": { + "methods": [ + "createShare" + ] + }, + "DeleteShare": { + "methods": [ + "deleteShare" + ] + }, + "UpdateShare": { + "methods": [ + "updateShare" + ] + }, "ListInstances": { "methods": [ "listInstances", @@ -126,12 +230,26 @@ "listInstancesAsync" ] }, + "ListSnapshots": { + "methods": [ + "listSnapshots", + "listSnapshotsStream", + "listSnapshotsAsync" + ] + }, "ListBackups": { "methods": [ "listBackups", "listBackupsStream", "listBackupsAsync" ] + }, + "ListShares": { + "methods": [ + "listShares", + "listSharesStream", + "listSharesAsync" + ] } } } diff --git a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts index 322ee26627e..9d44bfa8c5d 100644 --- a/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts +++ b/packages/google-cloud-filestore/test/gapic_cloud_filestore_manager_v1beta1.ts @@ -25,7 +25,12 @@ import * as cloudfilestoremanagerModule from '../src'; import {PassThrough} from 'stream'; -import {protobuf, LROperation, operationsProtos} from 'google-gax'; +import { + protobuf, + LROperation, + operationsProtos, + LocationProtos, +} from 'google-gax'; // Dynamically loaded proto JSON is needed to get the type information // to fill in default values for request objects @@ -403,6 +408,140 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); }); + describe('getSnapshot', () => { + it('invokes getSnapshot without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetSnapshotRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ); + client.innerApiCalls.getSnapshot = stubSimpleCall(expectedResponse); + const [response] = await client.getSnapshot(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetSnapshotRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ); + client.innerApiCalls.getSnapshot = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getSnapshot( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.ISnapshot | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetSnapshotRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getSnapshot = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getSnapshot with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetSnapshotRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetSnapshotRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getSnapshot(request), expectedError); + }); + }); + describe('getBackup', () => { it('invokes getBackup without error', async () => { const client = @@ -534,6 +673,137 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); }); + describe('getShare', () => { + it('invokes getShare without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ); + client.innerApiCalls.getShare = stubSimpleCall(expectedResponse); + const [response] = await client.getShare(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShare without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ); + client.innerApiCalls.getShare = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getShare( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.IShare | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShare with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.getShare = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getShare(request), expectedError); + const actualRequest = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.getShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getShare with closed client', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.GetShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.GetShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close(); + await assert.rejects(client.getShare(request), expectedError); + }); + }); + describe('createInstance', () => { it('invokes createInstance without error', async () => { const client = @@ -1138,8 +1408,8 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); }); - describe('deleteInstance', () => { - it('invokes deleteInstance without error', async () => { + describe('revertInstance', () => { + it('invokes revertInstance without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1147,10 +1417,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() + new protos.google.cloud.filestore.v1beta1.RevertInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + '.google.cloud.filestore.v1beta1.RevertInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -1158,22 +1428,22 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.revertInstance = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.revertInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance without error using callback', async () => { + it('invokes revertInstance without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1181,10 +1451,10 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() + new protos.google.cloud.filestore.v1beta1.RevertInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + '.google.cloud.filestore.v1beta1.RevertInstanceRequest', ['name'] ); request.name = defaultValue1; @@ -1192,15 +1462,15 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteInstance = + client.innerApiCalls.revertInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteInstance( + client.revertInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata > | null ) => { @@ -1213,22 +1483,22 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.IInstance, protos.google.cloud.common.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with call error', async () => { + it('invokes revertInstance with call error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1236,31 +1506,31 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() + new protos.google.cloud.filestore.v1beta1.RevertInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + '.google.cloud.filestore.v1beta1.RevertInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.revertInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteInstance(request), expectedError); + await assert.rejects(client.revertInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteInstance with LRO error', async () => { + it('invokes revertInstance with LRO error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1268,33 +1538,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() + new protos.google.cloud.filestore.v1beta1.RevertInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + '.google.cloud.filestore.v1beta1.RevertInstanceRequest', ['name'] ); request.name = defaultValue1; const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteInstance = stubLongRunningCall( + client.innerApiCalls.revertInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteInstance(request); + const [operation] = await client.revertInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteInstance as SinonStub + client.innerApiCalls.revertInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteInstanceProgress without error', async () => { + it('invokes checkRevertInstanceProgress without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1309,7 +1579,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteInstanceProgress( + const decodedOperation = await client.checkRevertInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1317,7 +1587,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteInstanceProgress with error', async () => { + it('invokes checkRevertInstanceProgress with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1331,15 +1601,15 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { expectedError ); await assert.rejects( - client.checkDeleteInstanceProgress(''), + client.checkRevertInstanceProgress(''), expectedError ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('createBackup', () => { - it('invokes createBackup without error', async () => { + describe('deleteInstance', () => { + it('invokes deleteInstance without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1347,32 +1617,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.CreateBackupRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackup(request); + client.innerApiCalls.deleteInstance = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteInstance(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup without error using callback', async () => { + it('invokes deleteInstance without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1380,26 +1651,26 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.CreateBackupRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.createBackup = + client.innerApiCalls.deleteInstance = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.createBackup( + client.deleteInstance( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata > | null ) => { @@ -1412,22 +1683,22 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with call error', async () => { + it('invokes deleteInstance with call error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1435,31 +1706,31 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.CreateBackupRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.createBackup(request), expectedError); + await assert.rejects(client.deleteInstance(request), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes createBackup with LRO error', async () => { + it('invokes deleteInstance with LRO error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1467,33 +1738,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteInstanceRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.CreateBackupRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.DeleteInstanceRequest', + ['name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.createBackup = stubLongRunningCall( + client.innerApiCalls.deleteInstance = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.createBackup(request); + const [operation] = await client.deleteInstance(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.createBackup as SinonStub + client.innerApiCalls.deleteInstance as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkCreateBackupProgress without error', async () => { + it('invokes checkDeleteInstanceProgress without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1508,7 +1779,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkCreateBackupProgress( + const decodedOperation = await client.checkDeleteInstanceProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1516,7 +1787,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkCreateBackupProgress with error', async () => { + it('invokes checkDeleteInstanceProgress with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1529,13 +1800,16 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { undefined, expectedError ); - await assert.rejects(client.checkCreateBackupProgress(''), expectedError); + await assert.rejects( + client.checkDeleteInstanceProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { + describe('createSnapshot', () => { + it('invokes createSnapshot without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1543,32 +1817,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + new protos.google.cloud.filestore.v1beta1.CreateSnapshotRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteBackupRequest', - ['name'] + '.google.cloud.filestore.v1beta1.CreateSnapshotRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); + client.innerApiCalls.createSnapshot = + stubLongRunningCall(expectedResponse); + const [operation] = await client.createSnapshot(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup without error using callback', async () => { + it('invokes createSnapshot without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1576,26 +1851,26 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + new protos.google.cloud.filestore.v1beta1.CreateSnapshotRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteBackupRequest', - ['name'] + '.google.cloud.filestore.v1beta1.CreateSnapshotRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.deleteBackup = + client.innerApiCalls.createSnapshot = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.deleteBackup( + client.createSnapshot( request, ( err?: Error | null, result?: LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata > | null ) => { @@ -1608,22 +1883,22 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.protobuf.IEmpty, + protos.google.cloud.filestore.v1beta1.ISnapshot, protos.google.cloud.common.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with call error', async () => { + it('invokes createSnapshot with call error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1631,31 +1906,31 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + new protos.google.cloud.filestore.v1beta1.CreateSnapshotRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteBackupRequest', - ['name'] + '.google.cloud.filestore.v1beta1.CreateSnapshotRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.createSnapshot = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.deleteBackup(request), expectedError); + await assert.rejects(client.createSnapshot(request), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes deleteBackup with LRO error', async () => { + it('invokes createSnapshot with LRO error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1663,33 +1938,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + new protos.google.cloud.filestore.v1beta1.CreateSnapshotRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.DeleteBackupRequest', - ['name'] + '.google.cloud.filestore.v1beta1.CreateSnapshotRequest', + ['parent'] ); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1}`; + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall( + client.innerApiCalls.createSnapshot = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.deleteBackup(request); + const [operation] = await client.createSnapshot(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.deleteBackup as SinonStub + client.innerApiCalls.createSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkDeleteBackupProgress without error', async () => { + it('invokes checkCreateSnapshotProgress without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1704,7 +1979,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkDeleteBackupProgress( + const decodedOperation = await client.checkCreateSnapshotProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1712,7 +1987,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkDeleteBackupProgress with error', async () => { + it('invokes checkCreateSnapshotProgress with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1725,13 +2000,16 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { undefined, expectedError ); - await assert.rejects(client.checkDeleteBackupProgress(''), expectedError); + await assert.rejects( + client.checkCreateSnapshotProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { + describe('deleteSnapshot', () => { + it('invokes deleteSnapshot without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1739,33 +2017,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteSnapshotRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.filestore.v1beta1.DeleteSnapshotRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); + client.innerApiCalls.deleteSnapshot = + stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteSnapshot(request); const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup without error using callback', async () => { + it('invokes deleteSnapshot without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1773,27 +2051,26 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteSnapshotRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.filestore.v1beta1.DeleteSnapshotRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedResponse = generateSampleMessage( new protos.google.longrunning.Operation() ); - client.innerApiCalls.updateBackup = + client.innerApiCalls.deleteSnapshot = stubLongRunningCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.updateBackup( + client.deleteSnapshot( request, ( err?: Error | null, result?: LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata > | null ) => { @@ -1806,22 +2083,22 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); const operation = (await promise) as LROperation< - protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.protobuf.IEmpty, protos.google.cloud.common.IOperationMetadata >; const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with call error', async () => { + it('invokes deleteSnapshot with call error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1829,32 +2106,31 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteSnapshotRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.filestore.v1beta1.DeleteSnapshotRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.deleteSnapshot = stubLongRunningCall( undefined, expectedError ); - await assert.rejects(client.updateBackup(request), expectedError); + await assert.rejects(client.deleteSnapshot(request), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes updateBackup with LRO error', async () => { + it('invokes deleteSnapshot with LRO error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1862,34 +2138,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + new protos.google.cloud.filestore.v1beta1.DeleteSnapshotRequest() ); - request.backup ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.UpdateBackupRequest', - ['backup', 'name'] + '.google.cloud.filestore.v1beta1.DeleteSnapshotRequest', + ['name'] ); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall( + client.innerApiCalls.deleteSnapshot = stubLongRunningCall( undefined, undefined, expectedError ); - const [operation] = await client.updateBackup(request); + const [operation] = await client.deleteSnapshot(request); await assert.rejects(operation.promise(), expectedError); const actualRequest = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.updateBackup as SinonStub + client.innerApiCalls.deleteSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes checkUpdateBackupProgress without error', async () => { + it('invokes checkDeleteSnapshotProgress without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1904,7 +2179,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; client.operationsClient.getOperation = stubSimpleCall(expectedResponse); - const decodedOperation = await client.checkUpdateBackupProgress( + const decodedOperation = await client.checkDeleteSnapshotProgress( expectedResponse.name ); assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); @@ -1912,7 +2187,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - it('invokes checkUpdateBackupProgress with error', async () => { + it('invokes checkDeleteSnapshotProgress with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1925,13 +2200,16 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { undefined, expectedError ); - await assert.rejects(client.checkUpdateBackupProgress(''), expectedError); + await assert.rejects( + client.checkDeleteSnapshotProgress(''), + expectedError + ); assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); }); - describe('listInstances', () => { - it('invokes listInstances without error', async () => { + describe('updateSnapshot', () => { + it('invokes updateSnapshot without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1939,39 +2217,34 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new protos.google.cloud.filestore.v1beta1.UpdateSnapshotRequest() ); + request.snapshot ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.UpdateSnapshotRequest', + ['snapshot', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() - ), - ]; - client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); - const [response] = await client.listInstances(request); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSnapshot = + stubLongRunningCall(expectedResponse); + const [operation] = await client.updateSnapshot(request); + const [response] = await operation.promise(); assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.updateSnapshot as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.updateSnapshot as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances without error using callback', async () => { + it('invokes updateSnapshot without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -1979,33 +2252,2426 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new protos.google.cloud.filestore.v1beta1.UpdateSnapshotRequest() ); + request.snapshot ??= {}; const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', - ['parent'] + '.google.cloud.filestore.v1beta1.UpdateSnapshotRequest', + ['snapshot', 'name'] ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() - ), - generateSampleMessage( + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateSnapshot = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateSnapshot( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.ISnapshot, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateSnapshotRequest', + ['snapshot', 'name'] + ); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSnapshot = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateSnapshot(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateSnapshot with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateSnapshotRequest() + ); + request.snapshot ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateSnapshotRequest', + ['snapshot', 'name'] + ); + request.snapshot.name = defaultValue1; + const expectedHeaderRequestParams = `snapshot.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateSnapshot = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateSnapshot(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateSnapshot as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateSnapshotProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateSnapshotProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateSnapshotProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateSnapshotProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createBackup', () => { + it('invokes createBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateBackupRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteBackupRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteBackupRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IBackup, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateBackupRequest', + ['backup', 'name'] + ); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateBackup as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('createShare', () => { + it('invokes createShare without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateShareRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createShare = stubLongRunningCall(expectedResponse); + const [operation] = await client.createShare(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createShare without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateShareRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createShare = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createShare( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createShare with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateShareRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createShare = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createShare(request), expectedError); + const actualRequest = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createShare with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.CreateShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.CreateShareRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.createShare = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createShare(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.createShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateShareProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateShareProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateShareProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkCreateShareProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteShare', () => { + it('invokes deleteShare without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteShare = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteShare(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteShare without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteShare = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteShare( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteShare with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteShare = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteShare(request), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteShare with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.DeleteShareRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.DeleteShareRequest', + ['name'] + ); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteShare = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteShare(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.deleteShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteShareProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteShareProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteShareProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkDeleteShareProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateShare', () => { + it('invokes updateShare without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateShareRequest() + ); + request.share ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateShareRequest', + ['share', 'name'] + ); + request.share.name = defaultValue1; + const expectedHeaderRequestParams = `share.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateShare = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateShare(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateShare without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateShareRequest() + ); + request.share ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateShareRequest', + ['share', 'name'] + ); + request.share.name = defaultValue1; + const expectedHeaderRequestParams = `share.name=${defaultValue1}`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateShare = + stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateShare( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.filestore.v1beta1.IShare, + protos.google.cloud.common.IOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateShare with call error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateShareRequest() + ); + request.share ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateShareRequest', + ['share', 'name'] + ); + request.share.name = defaultValue1; + const expectedHeaderRequestParams = `share.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateShare = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateShare(request), expectedError); + const actualRequest = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateShare with LRO error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.UpdateShareRequest() + ); + request.share ??= {}; + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.UpdateShareRequest', + ['share', 'name'] + ); + request.share.name = defaultValue1; + const expectedHeaderRequestParams = `share.name=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateShare = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateShare(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.updateShare as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateShareProgress without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateShareProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateShareProgress with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + 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.checkUpdateShareProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listInstances', () => { + it('invokes listInstances without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + ]; + client.innerApiCalls.listInstances = stubSimpleCall(expectedResponse); + const [response] = await client.listInstances(request); + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + ]; + client.innerApiCalls.listInstances = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listInstances( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.IInstance[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + 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 () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.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); + 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 () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.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.filestore.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listInstancesStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.filestore.v1beta1.Instance[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.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( + (client.descriptors.page.listInstances.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Instance() + ), + generateSampleMessage( new protos.google.cloud.filestore.v1beta1.Instance() ), + ]; + client.descriptors.page.listInstances.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.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( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listInstances with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListInstancesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + 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.filestore.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( + (client.descriptors.page.listInstances.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listSnapshots', () => { + it('invokes listSnapshots without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + ]; + client.innerApiCalls.listSnapshots = stubSimpleCall(expectedResponse); + const [response] = await client.listSnapshots(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + ]; + client.innerApiCalls.listSnapshots = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listSnapshots( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.ISnapshot[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshots with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listSnapshots = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSnapshots(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listSnapshots as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listSnapshotsStream without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + ]; + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Snapshot) => { + 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.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request) + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSnapshotsStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.createStream = + stubPageStreamingCall(undefined, expectedError); + const stream = client.listSnapshotsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Snapshot[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Snapshot) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSnapshots, request) + ); + assert( + (client.descriptors.page.listSnapshots.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSnapshots without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Snapshot() + ), + ]; + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.v1beta1.ISnapshot[] = []; + const iterable = client.listSnapshotsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listSnapshots with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSnapshotsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSnapshotsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listSnapshots.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listSnapshotsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.filestore.v1beta1.ISnapshot[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + ( + client.descriptors.page.listSnapshots.asyncIterate as SinonStub + ).getCall(0).args[1], + request + ); + assert( + (client.descriptors.page.listSnapshots.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.innerApiCalls.listBackups = + stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + ( + err?: Error | null, + result?: protos.google.cloud.filestore.v1beta1.IBackup[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listBackups as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), + ]; + client.descriptors.page.listBackups.createStream = + stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Backup) => { + 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.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Backup) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listBackups, request) + ); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() + ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new protos.google.cloud.filestore.v1beta1.Backup() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Backup() ), ]; - client.innerApiCalls.listInstances = + client.descriptors.page.listBackups.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListBackupsRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request + ); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listShares', () => { + it('invokes listShares without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSharesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + ]; + client.innerApiCalls.listShares = stubSimpleCall(expectedResponse); + const [response] = await client.listShares(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = ( + client.innerApiCalls.listShares as SinonStub + ).getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = ( + client.innerApiCalls.listShares as SinonStub + ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listShares without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSharesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + ]; + client.innerApiCalls.listShares = stubSimpleCallWithCallback(expectedResponse); const promise = new Promise((resolve, reject) => { - client.listInstances( + client.listShares( request, ( err?: Error | null, - result?: protos.google.cloud.filestore.v1beta1.IInstance[] | null + result?: protos.google.cloud.filestore.v1beta1.IShare[] | null ) => { if (err) { reject(err); @@ -2018,16 +4684,16 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const response = await promise; assert.deepStrictEqual(response, expectedResponse); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listShares as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listShares as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstances with error', async () => { + it('invokes listShares with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2035,31 +4701,31 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', + '.google.cloud.filestore.v1beta1.ListSharesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listInstances = stubSimpleCall( + client.innerApiCalls.listShares = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listInstances(request), expectedError); + await assert.rejects(client.listShares(request), expectedError); const actualRequest = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listShares as SinonStub ).getCall(0).args[0]; assert.deepStrictEqual(actualRequest, request); const actualHeaderRequestParams = ( - client.innerApiCalls.listInstances as SinonStub + client.innerApiCalls.listShares as SinonStub ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); }); - it('invokes listInstancesStream without error', async () => { + it('invokes listSharesStream without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2067,33 +4733,33 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', + '.google.cloud.filestore.v1beta1.ListSharesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new protos.google.cloud.filestore.v1beta1.Share() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new protos.google.cloud.filestore.v1beta1.Share() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new protos.google.cloud.filestore.v1beta1.Share() ), ]; - client.descriptors.page.listInstances.createStream = + client.descriptors.page.listShares.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listInstancesStream(request); + const stream = client.listSharesStream(request); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.filestore.v1beta1.Instance[] = []; + const responses: protos.google.cloud.filestore.v1beta1.Share[] = []; stream.on( 'data', - (response: protos.google.cloud.filestore.v1beta1.Instance) => { + (response: protos.google.cloud.filestore.v1beta1.Share) => { responses.push(response); } ); @@ -2107,12 +4773,114 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { const responses = await promise; assert.deepStrictEqual(responses, expectedResponse); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listShares.createStream as SinonStub) .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + .calledWith(client.innerApiCalls.listShares, request) + ); + assert( + (client.descriptors.page.listShares.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listSharesStream with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSharesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedError = new Error('expected'); + client.descriptors.page.listShares.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSharesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.filestore.v1beta1.Share[] = []; + stream.on( + 'data', + (response: protos.google.cloud.filestore.v1beta1.Share) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listShares.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listShares, request) + ); + assert( + (client.descriptors.page.listShares.createStream as SinonStub) + .getCall(0) + .args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listShares without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() + ); + const defaultValue1 = getTypeDefaultValue( + '.google.cloud.filestore.v1beta1.ListSharesRequest', + ['parent'] + ); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1}`; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + generateSampleMessage( + new protos.google.cloud.filestore.v1beta1.Share() + ), + ]; + client.descriptors.page.listShares.asyncIterate = + stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.filestore.v1beta1.IShare[] = []; + const iterable = client.listSharesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listShares.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listShares.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2120,7 +4888,7 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); - it('invokes listInstancesStream with error', async () => { + it('uses async iteration with listShares with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2128,49 +4896,43 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new protos.google.cloud.filestore.v1beta1.ListSharesRequest() ); const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', + '.google.cloud.filestore.v1beta1.ListSharesRequest', ['parent'] ); request.parent = defaultValue1; const expectedHeaderRequestParams = `parent=${defaultValue1}`; 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.filestore.v1beta1.Instance[] = []; - stream.on( - 'data', - (response: protos.google.cloud.filestore.v1beta1.Instance) => { - responses.push(response); - } - ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); + client.descriptors.page.listShares.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSharesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.filestore.v1beta1.IShare[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listInstances.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listInstances, request) + assert.deepStrictEqual( + (client.descriptors.page.listShares.asyncIterate as SinonStub).getCall( + 0 + ).args[1], + request ); assert( - (client.descriptors.page.listInstances.createStream as SinonStub) + (client.descriptors.page.listShares.asyncIterate as SinonStub) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams ) ); }); - - it('uses async iteration with listInstances without error', async () => { + }); + describe('getLocation', () => { + it('invokes getLocation without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2178,49 +4940,160 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', - ['parent'] + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + }); + it('invokes getLocation without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub).getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getLocation(request, expectedOptions), + expectedError + ); + assert( + (client.locationsClient.getLocation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new LocationProtos.google.cloud.location.Location() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new LocationProtos.google.cloud.location.Location() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Instance() + new LocationProtos.google.cloud.location.Location() ), ]; - client.descriptors.page.listInstances.asyncIterate = + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.filestore.v1beta1.IInstance[] = []; - const iterable = client.listInstancesAsync(request); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( ( - client.descriptors.page.listInstances.asyncIterate as SinonStub + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams ) ); }); - - it('uses async iteration with listInstances with error', async () => { + it('uses async iteration with listLocations with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2228,32 +5101,32 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListInstancesRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListInstancesRequest', - ['parent'] + new LocationProtos.google.cloud.location.ListLocationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; + request.name = ''; + const expectedHeaderRequestParams = 'name='; const expectedError = new Error('expected'); - client.descriptors.page.listInstances.asyncIterate = + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listInstancesAsync(request); + const iterable = client.listLocationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.filestore.v1beta1.IInstance[] = []; + const responses: LocationProtos.google.cloud.location.ILocation[] = []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( ( - client.descriptors.page.listInstances.asyncIterate as SinonStub + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub ).getCall(0).args[1], request ); assert( - (client.descriptors.page.listInstances.asyncIterate as SinonStub) + ( + client.locationsClient.descriptors.page.listLocations + .asyncIterate as SinonStub + ) .getCall(0) .args[2].otherArgs.headers['x-goog-request-params'].includes( expectedHeaderRequestParams @@ -2261,9 +5134,8 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { ); }); }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { + describe('getOperation', () => { + it('invokes getOperation without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2271,39 +5143,81 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + new operationsProtos.google.longrunning.GetOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const response = await client.getOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes getOperation without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + client.operationsClient.getOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.operationsClient.getOperation( + request, + undefined, + ( + err?: Error | null, + result?: operationsProtos.google.longrunning.Operation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); }); - - it('invokes listBackups without error using callback', async () => { + it('invokes getOperation with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.GetOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(async () => { + await client.getOperation(request); + }, expectedError); + assert( + (client.operationsClient.getOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + }); + describe('cancelOperation', () => { + it('invokes cancelOperation without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2311,33 +5225,43 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + new operationsProtos.google.longrunning.CancelOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - ]; - client.innerApiCalls.listBackups = - stubSimpleCallWithCallback(expectedResponse); + client.operationsClient.cancelOperation = + stubSimpleCall(expectedResponse); + const response = await client.cancelOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); + }); + it('invokes cancelOperation without error using callback', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.CancelOperationRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.operationsClient.cancelOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - client.listBackups( + client.operationsClient.cancelOperation( request, + undefined, ( err?: Error | null, - result?: protos.google.cloud.filestore.v1beta1.IBackup[] | null + result?: protos.google.protobuf.Empty | null ) => { if (err) { reject(err); @@ -2349,49 +5273,34 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); const response = await promise; assert.deepStrictEqual(response, expectedResponse); - const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + assert((client.operationsClient.cancelOperation as SinonStub).getCall(0)); }); - - it('invokes listBackups with error', async () => { + it('invokes cancelOperation with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] + new operationsProtos.google.longrunning.CancelOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall( + client.operationsClient.cancelOperation = stubSimpleCall( undefined, expectedError ); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = ( - client.innerApiCalls.listBackups as SinonStub - ).getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + await assert.rejects(async () => { + await client.cancelOperation(request); + }, expectedError); + assert( + (client.operationsClient.cancelOperation as SinonStub) + .getCall(0) + .calledWith(request) + ); }); - - it('invokes listBackupsStream without error', async () => { + }); + describe('deleteOperation', () => { + it('invokes deleteOperation without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2399,162 +5308,119 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedResponse = [ - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() - ), - ]; - client.descriptors.page.listBackups.createStream = - stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; - stream.on( - 'data', - (response: protos.google.cloud.filestore.v1beta1.Backup) => { - 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.listBackups.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); + client.operationsClient.deleteOperation = + stubSimpleCall(expectedResponse); + const response = await client.deleteOperation(request); + assert.deepStrictEqual(response, [expectedResponse]); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('invokes listBackupsStream with error', async () => { + it('invokes deleteOperation without error using callback', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + new operationsProtos.google.longrunning.DeleteOperationRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall( - undefined, - expectedError + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() ); - const stream = client.listBackupsStream(request); + client.operationsClient.deleteOperation = sinon + .stub() + .callsArgWith(2, null, expectedResponse); const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.filestore.v1beta1.Backup[] = []; - stream.on( - 'data', - (response: protos.google.cloud.filestore.v1beta1.Backup) => { - responses.push(response); + client.operationsClient.deleteOperation( + request, + undefined, + ( + err?: Error | null, + result?: protos.google.protobuf.Empty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } } ); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); }); - await assert.rejects(promise, expectedError); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0) - .calledWith(client.innerApiCalls.listBackups, request) + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.operationsClient.deleteOperation as SinonStub).getCall(0)); + }); + it('invokes deleteOperation with error', async () => { + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + const request = generateSampleMessage( + new operationsProtos.google.longrunning.DeleteOperationRequest() + ); + const expectedError = new Error('expected'); + client.operationsClient.deleteOperation = stubSimpleCall( + undefined, + expectedError ); + await assert.rejects(async () => { + await client.deleteOperation(request); + }, expectedError); assert( - (client.descriptors.page.listBackups.createStream as SinonStub) + (client.operationsClient.deleteOperation as SinonStub) .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) + .calledWith(request) ); }); - - it('uses async iteration with listBackups without error', async () => { + }); + describe('listOperationsAsync', () => { + it('uses async iteration with listOperations without error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); - client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() - ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] + new operationsProtos.google.longrunning.ListOperationsRequest() ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedResponse = [ generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() + new operationsProtos.google.longrunning.ListOperationsResponse() ), generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.Backup() + new operationsProtos.google.longrunning.ListOperationsResponse() ), ]; - client.descriptors.page.listBackups.asyncIterate = + client.operationsClient.descriptor.listOperations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; - const iterable = client.listBackupsAsync(request); + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; + const iterable = client.operationsClient.listOperationsAsync(request); for await (const resource of iterable) { responses.push(resource!); } assert.deepStrictEqual(responses, expectedResponse); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); - - it('uses async iteration with listBackups with error', async () => { + it('uses async iteration with listOperations with error', async () => { const client = new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, @@ -2562,39 +5428,26 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); client.initialize(); const request = generateSampleMessage( - new protos.google.cloud.filestore.v1beta1.ListBackupsRequest() + new operationsProtos.google.longrunning.ListOperationsRequest() ); - const defaultValue1 = getTypeDefaultValue( - '.google.cloud.filestore.v1beta1.ListBackupsRequest', - ['parent'] - ); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1}`; const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall( - undefined, - expectedError - ); - const iterable = client.listBackupsAsync(request); + client.operationsClient.descriptor.listOperations.asyncIterate = + stubAsyncIterationCall(undefined, expectedError); + const iterable = client.operationsClient.listOperationsAsync(request); await assert.rejects(async () => { - const responses: protos.google.cloud.filestore.v1beta1.IBackup[] = []; + const responses: operationsProtos.google.longrunning.ListOperationsResponse[] = + []; for await (const resource of iterable) { responses.push(resource!); } }); assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub).getCall( - 0 - ).args[1], + ( + client.operationsClient.descriptor.listOperations + .asyncIterate as SinonStub + ).getCall(0).args[1], request ); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0) - .args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); }); }); @@ -2779,6 +5632,83 @@ describe('v1beta1.CloudFilestoreManagerClient', () => { }); }); + describe('share', () => { + const fakePath = '/rendered/path/share'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + instance: 'instanceValue', + share: 'shareValue', + }; + const client = + new cloudfilestoremanagerModule.v1beta1.CloudFilestoreManagerClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.sharePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.sharePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('sharePath', () => { + const result = client.sharePath( + 'projectValue', + 'locationValue', + 'instanceValue', + 'shareValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.sharePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromShareName', () => { + const result = client.matchProjectFromShareName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.sharePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromShareName', () => { + const result = client.matchLocationFromShareName(fakePath); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.sharePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchInstanceFromShareName', () => { + const result = client.matchInstanceFromShareName(fakePath); + assert.strictEqual(result, 'instanceValue'); + assert( + (client.pathTemplates.sharePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchShareFromShareName', () => { + const result = client.matchShareFromShareName(fakePath); + assert.strictEqual(result, 'shareValue'); + assert( + (client.pathTemplates.sharePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('snapshot', () => { const fakePath = '/rendered/path/snapshot'; const expectedParameters = { From d89ab4e566655677235491d3963ff3fcdad5f5a3 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Thu, 10 Nov 2022 18:36:16 -0800 Subject: [PATCH 53/59] Update .repo-metadata.json --- packages/google-cloud-filestore/.repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index 4539210accc..03e744f7b74 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "filestore", + "name": "file", "name_pretty": "Filestore", "product_documentation": "https://cloud.google.com/filestore/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/filestore/latest", From 60af350be440baa8cb77b23f5dd7bc9f23cfa5ad Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 11 Nov 2022 19:18:14 +0000 Subject: [PATCH 54/59] chore(main): release 2.2.0 (#79) :robot: I have created a release *beep* *boop* --- ## [2.2.0](https://togithub.com/googleapis/nodejs-filestore/compare/v2.1.0...v2.2.0) (2022-11-11) ### Features * New APIs added to reflect updates to the filestore service ([#93](https://togithub.com/googleapis/nodejs-filestore/issues/93)) ([619e7f1](https://togithub.com/googleapis/nodejs-filestore/commit/619e7f142a621303afc58b38261711d33584ea5f)) ### Bug Fixes * Allow passing gax instance to client constructor ([#82](https://togithub.com/googleapis/nodejs-filestore/issues/82)) ([37a928b](https://togithub.com/googleapis/nodejs-filestore/commit/37a928bf3c049d0cd66e4efa5d41717fa5ff9a28)) * Better support for fallback mode ([#77](https://togithub.com/googleapis/nodejs-filestore/issues/77)) ([c339f3f](https://togithub.com/googleapis/nodejs-filestore/commit/c339f3f49c0a10fd2d42a64de20a9d2f06ae061e)) * Change import long to require ([#78](https://togithub.com/googleapis/nodejs-filestore/issues/78)) ([c9ce9d1](https://togithub.com/googleapis/nodejs-filestore/commit/c9ce9d147dd1cc6f99b63e53af9cf75c1999dc90)) * **deps:** Use google-gax v3.5.2 ([#89](https://togithub.com/googleapis/nodejs-filestore/issues/89)) ([5fde972](https://togithub.com/googleapis/nodejs-filestore/commit/5fde972b08be1106b42bce644f1282f690b93677)) * Do not import the whole google-gax from proto JS ([#1553](https://togithub.com/googleapis/nodejs-filestore/issues/1553)) ([#81](https://togithub.com/googleapis/nodejs-filestore/issues/81)) ([e0b4ac4](https://togithub.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) * Preserve default values in x-goog-request-params header ([#83](https://togithub.com/googleapis/nodejs-filestore/issues/83)) ([2cd3cb0](https://togithub.com/googleapis/nodejs-filestore/commit/2cd3cb022d1cb11fa3d04dbda58fd32de995c462)) * Regenerated protos JS and TS definitions ([#92](https://togithub.com/googleapis/nodejs-filestore/issues/92)) ([cb324b9](https://togithub.com/googleapis/nodejs-filestore/commit/cb324b9f3f93eaea7228386e5bf406ed570bafcc)) * Remove pip install statements ([#1546](https://togithub.com/googleapis/nodejs-filestore/issues/1546)) ([#80](https://togithub.com/googleapis/nodejs-filestore/issues/80)) ([73de8d6](https://togithub.com/googleapis/nodejs-filestore/commit/73de8d63b8b221df09c193400d1028cf3924a6ae)) * use google-gax v3.3.0 ([e0b4ac4](https://togithub.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) --- 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-filestore/CHANGELOG.md | 20 +++++++++++++++++++ packages/google-cloud-filestore/package.json | 2 +- ...et_metadata.google.cloud.filestore.v1.json | 2 +- ...tadata.google.cloud.filestore.v1beta1.json | 2 +- .../samples/package.json | 2 +- 5 files changed, 24 insertions(+), 4 deletions(-) diff --git a/packages/google-cloud-filestore/CHANGELOG.md b/packages/google-cloud-filestore/CHANGELOG.md index 6a2359ffdd7..79188054a86 100644 --- a/packages/google-cloud-filestore/CHANGELOG.md +++ b/packages/google-cloud-filestore/CHANGELOG.md @@ -1,5 +1,25 @@ # Changelog +## [2.2.0](https://github.com/googleapis/nodejs-filestore/compare/v2.1.0...v2.2.0) (2022-11-11) + + +### Features + +* New APIs added to reflect updates to the filestore service ([#93](https://github.com/googleapis/nodejs-filestore/issues/93)) ([619e7f1](https://github.com/googleapis/nodejs-filestore/commit/619e7f142a621303afc58b38261711d33584ea5f)) + + +### Bug Fixes + +* Allow passing gax instance to client constructor ([#82](https://github.com/googleapis/nodejs-filestore/issues/82)) ([37a928b](https://github.com/googleapis/nodejs-filestore/commit/37a928bf3c049d0cd66e4efa5d41717fa5ff9a28)) +* Better support for fallback mode ([#77](https://github.com/googleapis/nodejs-filestore/issues/77)) ([c339f3f](https://github.com/googleapis/nodejs-filestore/commit/c339f3f49c0a10fd2d42a64de20a9d2f06ae061e)) +* Change import long to require ([#78](https://github.com/googleapis/nodejs-filestore/issues/78)) ([c9ce9d1](https://github.com/googleapis/nodejs-filestore/commit/c9ce9d147dd1cc6f99b63e53af9cf75c1999dc90)) +* **deps:** Use google-gax v3.5.2 ([#89](https://github.com/googleapis/nodejs-filestore/issues/89)) ([5fde972](https://github.com/googleapis/nodejs-filestore/commit/5fde972b08be1106b42bce644f1282f690b93677)) +* Do not import the whole google-gax from proto JS ([#1553](https://github.com/googleapis/nodejs-filestore/issues/1553)) ([#81](https://github.com/googleapis/nodejs-filestore/issues/81)) ([e0b4ac4](https://github.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) +* Preserve default values in x-goog-request-params header ([#83](https://github.com/googleapis/nodejs-filestore/issues/83)) ([2cd3cb0](https://github.com/googleapis/nodejs-filestore/commit/2cd3cb022d1cb11fa3d04dbda58fd32de995c462)) +* Regenerated protos JS and TS definitions ([#92](https://github.com/googleapis/nodejs-filestore/issues/92)) ([cb324b9](https://github.com/googleapis/nodejs-filestore/commit/cb324b9f3f93eaea7228386e5bf406ed570bafcc)) +* Remove pip install statements ([#1546](https://github.com/googleapis/nodejs-filestore/issues/1546)) ([#80](https://github.com/googleapis/nodejs-filestore/issues/80)) ([73de8d6](https://github.com/googleapis/nodejs-filestore/commit/73de8d63b8b221df09c193400d1028cf3924a6ae)) +* use google-gax v3.3.0 ([e0b4ac4](https://github.com/googleapis/nodejs-filestore/commit/e0b4ac42145ad648f3ae5f6c77917a2dd94d5192)) + ## [2.1.0](https://github.com/googleapis/nodejs-filestore/compare/v2.0.0...v2.1.0) (2022-06-30) diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index a21aaa3056b..375004bf1ab 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -1,6 +1,6 @@ { "name": "@google-cloud/filestore", - "version": "2.1.0", + "version": "2.2.0", "description": "file client for Node.js", "repository": "googleapis/nodejs-filestore", "license": "Apache-2.0", diff --git a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json index 9959a93643a..7ea6fe4591b 100644 --- a/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json +++ b/packages/google-cloud-filestore/samples/generated/v1/snippet_metadata.google.cloud.filestore.v1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "2.1.0", + "version": "2.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json index 2b95f20aa25..054a1c308fa 100644 --- a/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json +++ b/packages/google-cloud-filestore/samples/generated/v1beta1/snippet_metadata.google.cloud.filestore.v1beta1.json @@ -1,7 +1,7 @@ { "clientLibrary": { "name": "nodejs-filestore", - "version": "2.1.0", + "version": "2.2.0", "language": "TYPESCRIPT", "apis": [ { diff --git a/packages/google-cloud-filestore/samples/package.json b/packages/google-cloud-filestore/samples/package.json index d6ab1ac50db..aecd70d1f0c 100644 --- a/packages/google-cloud-filestore/samples/package.json +++ b/packages/google-cloud-filestore/samples/package.json @@ -13,7 +13,7 @@ "test": "c8 mocha --timeout 600000 test/*.js" }, "dependencies": { - "@google-cloud/filestore": "^2.1.0" + "@google-cloud/filestore": "^2.2.0" }, "devDependencies": { "c8": "^7.3.0", From 0384480b5f806b18b57fa4ed013bcd2b7716c7e0 Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 11 Nov 2022 18:26:10 -0800 Subject: [PATCH 55/59] Update .repo-metadata.json --- packages/google-cloud-filestore/.repo-metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index 03e744f7b74..e8908ed7582 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -1,5 +1,6 @@ { - "name": "file", + "name": "filestore",' + "api_shortname": "file", "name_pretty": "Filestore", "product_documentation": "https://cloud.google.com/filestore/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/filestore/latest", From 521a9c221b335a86d207df1c935e25f717ff04aa Mon Sep 17 00:00:00 2001 From: sofisl <55454395+sofisl@users.noreply.github.com> Date: Fri, 11 Nov 2022 18:42:24 -0800 Subject: [PATCH 56/59] Update .repo-metadata.json --- packages/google-cloud-filestore/.repo-metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/google-cloud-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index e8908ed7582..5011453f7c5 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -1,5 +1,5 @@ { - "name": "filestore",' + "name": "filestore", "api_shortname": "file", "name_pretty": "Filestore", "product_documentation": "https://cloud.google.com/filestore/", From 81e473728dccd8284f4cf1b8892427d678cad034 Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Fri, 11 Nov 2022 18:52:54 -0800 Subject: [PATCH 57/59] build: add release-please config, fix owlbot-config --- .release-please-manifest.json | 3 +- .../{.github => }/.OwlBot.yaml | 6 +- packages/google-cloud-filestore/.mocharc.js | 2 +- .../google-cloud-filestore/.prettierrc.js | 2 +- .../.repo-metadata.json | 7 +- packages/google-cloud-filestore/README.md | 48 +- packages/google-cloud-filestore/package.json | 13 +- .../google-cloud-filestore/samples/README.md | 624 +++++++++++++++++- packages/google-cloud-filestore/src/index.ts | 2 +- release-please-config.json | 5 +- 10 files changed, 681 insertions(+), 31 deletions(-) rename packages/google-cloud-filestore/{.github => }/.OwlBot.yaml (79%) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0f5c0ebec38..b3c9fbf103e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -24,6 +24,7 @@ "packages/google-cloud-dialogflow": "5.3.0", "packages/google-cloud-discoveryengine": "0.2.0", "packages/google-cloud-documentai": "6.1.0", + "packages/google-cloud-filestore": "2.2.0", "packages/google-cloud-gkeconnect-gateway": "2.0.5", "packages/google-cloud-gkemulticloud": "0.1.4", "packages/google-cloud-iot": "3.1.2", @@ -38,8 +39,8 @@ "packages/google-cloud-recommender": "5.0.4", "packages/google-cloud-redis": "3.1.5", "packages/google-cloud-resourcemanager": "4.1.3", - "packages/google-cloud-secretmanager": "4.1.4", "packages/google-cloud-scheduler": "3.0.5", + "packages/google-cloud-secretmanager": "4.1.4", "packages/google-cloud-security-publicca": "0.1.3", "packages/google-cloud-servicedirectory": "4.0.4", "packages/google-cloud-shell": "2.0.4", diff --git a/packages/google-cloud-filestore/.github/.OwlBot.yaml b/packages/google-cloud-filestore/.OwlBot.yaml similarity index 79% rename from packages/google-cloud-filestore/.github/.OwlBot.yaml rename to packages/google-cloud-filestore/.OwlBot.yaml index e917fee3c4c..a9e89d47113 100644 --- a/packages/google-cloud-filestore/.github/.OwlBot.yaml +++ b/packages/google-cloud-filestore/.OwlBot.yaml @@ -11,12 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -docker: - image: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest deep-remove-regex: - /owl-bot-staging deep-copy-regex: - - source: /google/cloud/filestore/(.*)/.*-nodejs/(.*) - dest: /owl-bot-staging/$1/$2 + - source: /google/cloud/filestore/(.*)/.*-nodejs + dest: /owl-bot-staging/google-cloud-filestore/$1 diff --git a/packages/google-cloud-filestore/.mocharc.js b/packages/google-cloud-filestore/.mocharc.js index 0b600509bed..cdb7b752160 100644 --- a/packages/google-cloud-filestore/.mocharc.js +++ b/packages/google-cloud-filestore/.mocharc.js @@ -1,4 +1,4 @@ -// Copyright 2020 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-filestore/.prettierrc.js b/packages/google-cloud-filestore/.prettierrc.js index d1b95106f4c..d546a4ad546 100644 --- a/packages/google-cloud-filestore/.prettierrc.js +++ b/packages/google-cloud-filestore/.prettierrc.js @@ -1,4 +1,4 @@ -// Copyright 2020 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-filestore/.repo-metadata.json b/packages/google-cloud-filestore/.repo-metadata.json index 5011453f7c5..cccd51f65b1 100644 --- a/packages/google-cloud-filestore/.repo-metadata.json +++ b/packages/google-cloud-filestore/.repo-metadata.json @@ -1,17 +1,16 @@ { "name": "filestore", - "api_shortname": "file", + "api_shortname": "filestore", "name_pretty": "Filestore", "product_documentation": "https://cloud.google.com/filestore/", "client_documentation": "https://cloud.google.com/nodejs/docs/reference/filestore/latest", - "issue_tracker": "https://github.com/googleapis/nodejs-filestore/issues", + "issue_tracker": "https://github.com/googleapis/google-cloud-node/issues", "release_level": "stable", "language": "nodejs", - "repo": "googleapis/nodejs-filestore", + "repo": "googleapis/google-cloud-node", "distribution_name": "@google-cloud/filestore", "api_id": "file.googleapis.com", "default_version": "v1", "requires_billing": true, - "api_shortname": "filestore", "library_type": "GAPIC_AUTO" } diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index 4b9848f581b..b645c7fe841 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Filestore: Node.js Client](https://github.com/googleapis/nodejs-filestore) +# [Filestore: Node.js Client](https://github.com/googleapis/google-cloud-node) [![release level](https://img.shields.io/badge/release%20level-stable-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) [![npm version](https://img.shields.io/npm/v/@google-cloud/filestore.svg)](https://www.npmjs.org/package/@google-cloud/filestore) @@ -14,11 +14,11 @@ file client for Node.js A comprehensive list of changes in each version may be found in -[the CHANGELOG](https://github.com/googleapis/nodejs-filestore/blob/main/CHANGELOG.md). +[the CHANGELOG](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore/CHANGELOG.md). * [Filestore Node.js Client API Reference][client-docs] * [Filestore Documentation][product-docs] -* [github.com/googleapis/nodejs-filestore](https://github.com/googleapis/nodejs-filestore) +* [github.com/googleapis/google-cloud-node/packages/google-cloud-filestore](https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore) Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in [Client Libraries Explained][explained]. @@ -81,11 +81,45 @@ listInstances(); ## Samples -Samples are in the [`samples/`](https://github.com/googleapis/nodejs-filestore/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. +Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/tree/main/samples) directory. Each sample's `README.md` has instructions for running its sample. | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Quickstart | [source code](https://github.com/googleapis/nodejs-filestore/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-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) | +| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) | +| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) | +| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) | +| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) | +| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) | +| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) | +| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) | +| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) | +| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) | +| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) | +| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) | +| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) | +| Cloud_filestore_manager.create_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) | +| Cloud_filestore_manager.create_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) | +| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) | +| Cloud_filestore_manager.delete_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) | +| Cloud_filestore_manager.delete_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) | +| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) | +| Cloud_filestore_manager.get_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) | +| Cloud_filestore_manager.get_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) | +| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) | +| Cloud_filestore_manager.list_shares | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) | +| Cloud_filestore_manager.list_snapshots | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) | +| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) | +| Cloud_filestore_manager.revert_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) | +| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) | +| Cloud_filestore_manager.update_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) | @@ -135,7 +169,7 @@ More Information: [Google Cloud Platform Launch Stages][launch_stages] ## Contributing -Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/nodejs-filestore/blob/main/CONTRIBUTING.md). +Contributions welcome! See the [Contributing Guide](https://github.com/googleapis/google-cloud-node/blob/main/CONTRIBUTING.md). Please note that this `README.md`, the `samples/README.md`, and a variety of configuration files in this repository (including `.nycrc` and `tsconfig.json`) @@ -147,7 +181,7 @@ to its templates in Apache Version 2.0 -See [LICENSE](https://github.com/googleapis/nodejs-filestore/blob/main/LICENSE) +See [LICENSE](https://github.com/googleapis/google-cloud-node/blob/main/LICENSE) [client-docs]: https://cloud.google.com/nodejs/docs/reference/filestore/latest [product-docs]: https://cloud.google.com/filestore/ diff --git a/packages/google-cloud-filestore/package.json b/packages/google-cloud-filestore/package.json index 375004bf1ab..8d20c8d57b0 100644 --- a/packages/google-cloud-filestore/package.json +++ b/packages/google-cloud-filestore/package.json @@ -2,7 +2,11 @@ "name": "@google-cloud/filestore", "version": "2.2.0", "description": "file client for Node.js", - "repository": "googleapis/nodejs-filestore", + "repository": { + "type": "git", + "directory": "packages/google-cloud-filestore", + "url": "https://github.com/googleapis/google-cloud-node.git" + }, "license": "Apache-2.0", "author": "Google LLC", "main": "build/src/index.js", @@ -34,8 +38,8 @@ "prelint": "cd samples; npm link ../; npm install", "lint": "gts check", "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "samples-test": "cd samples/ && npm link ../ && npm test && cd ../", + "system-test": "npm run compile && c8 mocha build/system-test", + "samples-test": "npm run compile && cd samples/ && npm link ../ && npm i && npm test", "test": "c8 mocha build/test" }, "dependencies": { @@ -62,5 +66,6 @@ }, "engines": { "node": ">=12.0.0" - } + }, + "homepage": "https://github.com/googleapis/google-cloud-node/tree/main/packages/google-cloud-filestore" } diff --git a/packages/google-cloud-filestore/samples/README.md b/packages/google-cloud-filestore/samples/README.md index 272d9a920ad..331b8fa7ef7 100644 --- a/packages/google-cloud-filestore/samples/README.md +++ b/packages/google-cloud-filestore/samples/README.md @@ -2,7 +2,7 @@ [//]: # "To regenerate it, use `python -m synthtool`." Google Cloud Platform logo -# [Filestore: Node.js Samples](https://github.com/googleapis/nodejs-filestore) +# [Filestore: Node.js Samples](https://github.com/googleapis/google-cloud-node) [![Open in Cloud Shell][shell_img]][shell_link] @@ -12,12 +12,46 @@ * [Before you begin](#before-you-begin) * [Samples](#samples) + * [Cloud_filestore_manager.create_backup](#cloud_filestore_manager.create_backup) + * [Cloud_filestore_manager.create_instance](#cloud_filestore_manager.create_instance) + * [Cloud_filestore_manager.delete_backup](#cloud_filestore_manager.delete_backup) + * [Cloud_filestore_manager.delete_instance](#cloud_filestore_manager.delete_instance) + * [Cloud_filestore_manager.get_backup](#cloud_filestore_manager.get_backup) + * [Cloud_filestore_manager.get_instance](#cloud_filestore_manager.get_instance) + * [Cloud_filestore_manager.list_backups](#cloud_filestore_manager.list_backups) + * [Cloud_filestore_manager.list_instances](#cloud_filestore_manager.list_instances) + * [Cloud_filestore_manager.restore_instance](#cloud_filestore_manager.restore_instance) + * [Cloud_filestore_manager.update_backup](#cloud_filestore_manager.update_backup) + * [Cloud_filestore_manager.update_instance](#cloud_filestore_manager.update_instance) + * [Cloud_filestore_manager.create_backup](#cloud_filestore_manager.create_backup) + * [Cloud_filestore_manager.create_instance](#cloud_filestore_manager.create_instance) + * [Cloud_filestore_manager.create_share](#cloud_filestore_manager.create_share) + * [Cloud_filestore_manager.create_snapshot](#cloud_filestore_manager.create_snapshot) + * [Cloud_filestore_manager.delete_backup](#cloud_filestore_manager.delete_backup) + * [Cloud_filestore_manager.delete_instance](#cloud_filestore_manager.delete_instance) + * [Cloud_filestore_manager.delete_share](#cloud_filestore_manager.delete_share) + * [Cloud_filestore_manager.delete_snapshot](#cloud_filestore_manager.delete_snapshot) + * [Cloud_filestore_manager.get_backup](#cloud_filestore_manager.get_backup) + * [Cloud_filestore_manager.get_instance](#cloud_filestore_manager.get_instance) + * [Cloud_filestore_manager.get_share](#cloud_filestore_manager.get_share) + * [Cloud_filestore_manager.get_snapshot](#cloud_filestore_manager.get_snapshot) + * [Cloud_filestore_manager.list_backups](#cloud_filestore_manager.list_backups) + * [Cloud_filestore_manager.list_instances](#cloud_filestore_manager.list_instances) + * [Cloud_filestore_manager.list_shares](#cloud_filestore_manager.list_shares) + * [Cloud_filestore_manager.list_snapshots](#cloud_filestore_manager.list_snapshots) + * [Cloud_filestore_manager.restore_instance](#cloud_filestore_manager.restore_instance) + * [Cloud_filestore_manager.revert_instance](#cloud_filestore_manager.revert_instance) + * [Cloud_filestore_manager.update_backup](#cloud_filestore_manager.update_backup) + * [Cloud_filestore_manager.update_instance](#cloud_filestore_manager.update_instance) + * [Cloud_filestore_manager.update_share](#cloud_filestore_manager.update_share) + * [Cloud_filestore_manager.update_snapshot](#cloud_filestore_manager.update_snapshot) + * [Quickstart](#quickstart) * [Quickstart](#quickstart) ## Before you begin Before running the samples, make sure you've followed the steps outlined in -[Using the client library](https://github.com/googleapis/nodejs-filestore#using-the-client-library). +[Using the client library](https://github.com/googleapis/google-cloud-node#using-the-client-library). `cd samples` @@ -29,16 +63,594 @@ Before running the samples, make sure you've followed the steps outlined in +### Cloud_filestore_manager.create_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js` + + +----- + + + + +### Cloud_filestore_manager.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js` + + +----- + + + + +### Cloud_filestore_manager.delete_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js` + + +----- + + + + +### Cloud_filestore_manager.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js` + + +----- + + + + +### Cloud_filestore_manager.get_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js` + + +----- + + + + +### Cloud_filestore_manager.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js` + + +----- + + + + +### Cloud_filestore_manager.list_backups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js` + + +----- + + + + +### Cloud_filestore_manager.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js` + + +----- + + + + +### Cloud_filestore_manager.restore_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js` + + +----- + + + + +### Cloud_filestore_manager.update_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js` + + +----- + + + + +### Cloud_filestore_manager.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js` + + +----- + + + + +### Cloud_filestore_manager.create_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js` + + +----- + + + + +### Cloud_filestore_manager.create_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js` + + +----- + + + + +### Cloud_filestore_manager.create_share + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js` + + +----- + + + + +### Cloud_filestore_manager.create_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js` + + +----- + + + + +### Cloud_filestore_manager.delete_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js` + + +----- + + + + +### Cloud_filestore_manager.delete_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js` + + +----- + + + + +### Cloud_filestore_manager.delete_share + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js` + + +----- + + + + +### Cloud_filestore_manager.delete_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js` + + +----- + + + + +### Cloud_filestore_manager.get_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js` + + +----- + + + + +### Cloud_filestore_manager.get_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js` + + +----- + + + + +### Cloud_filestore_manager.get_share + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js` + + +----- + + + + +### Cloud_filestore_manager.get_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js` + + +----- + + + + +### Cloud_filestore_manager.list_backups + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js` + + +----- + + + + +### Cloud_filestore_manager.list_instances + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js` + + +----- + + + + +### Cloud_filestore_manager.list_shares + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js` + + +----- + + + + +### Cloud_filestore_manager.list_snapshots + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js` + + +----- + + + + +### Cloud_filestore_manager.restore_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js` + + +----- + + + + +### Cloud_filestore_manager.revert_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js` + + +----- + + + + +### Cloud_filestore_manager.update_backup + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js` + + +----- + + + + +### Cloud_filestore_manager.update_instance + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js` + + +----- + + + + +### Cloud_filestore_manager.update_share + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js` + + +----- + + + + +### Cloud_filestore_manager.update_snapshot + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js` + + +----- + + + + +### Quickstart + +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). + +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) + +__Usage:__ + + +`node /workspace/google-cloud-node/samples/quickstart.js` + + +----- + + + + ### Quickstart -View the [source code](https://github.com/googleapis/nodejs-filestore/blob/main/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-filestore&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node samples/quickstart.js` +`node /workspace/google-cloud-node/samples/test/quickstart.js` @@ -46,5 +658,5 @@ __Usage:__ [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-filestore&page=editor&open_in_editor=samples/README.md +[shell_link]: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=samples/README.md [product-docs]: https://cloud.google.com/filestore/ diff --git a/packages/google-cloud-filestore/src/index.ts b/packages/google-cloud-filestore/src/index.ts index 890bc401302..afceb97cd18 100644 --- a/packages/google-cloud-filestore/src/index.ts +++ b/packages/google-cloud-filestore/src/index.ts @@ -1,4 +1,4 @@ -// Copyright 2020 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/release-please-config.json b/release-please-config.json index 474a686655d..3f14f470471 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -25,6 +25,7 @@ "packages/google-cloud-dialogflow": {}, "packages/google-cloud-discoveryengine": {}, "packages/google-cloud-documentai": {}, + "packages/google-cloud-filestore": {}, "packages/google-cloud-gkeconnect-gateway": {}, "packages/google-cloud-gkemulticloud": {}, "packages/google-cloud-iot": {}, @@ -39,8 +40,8 @@ "packages/google-cloud-recommender": {}, "packages/google-cloud-redis": {}, "packages/google-cloud-resourcemanager": {}, - "packages/google-cloud-secretmanager": {}, "packages/google-cloud-scheduler": {}, + "packages/google-cloud-secretmanager": {}, "packages/google-cloud-security-publicca": {}, "packages/google-cloud-servicedirectory": {}, "packages/google-cloud-shell": {}, @@ -63,4 +64,4 @@ } ], "release-type": "node" -} \ No newline at end of file +} From d50e1d0726e6d2954442082402a7236d7ecf7cfc Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 12 Nov 2022 03:46:07 +0000 Subject: [PATCH 58/59] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20?= =?UTF-8?q?post-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- packages/google-cloud-filestore/README.md | 70 +++--- .../google-cloud-filestore/samples/README.md | 210 +++++++++--------- release-please-config.json | 2 +- 3 files changed, 141 insertions(+), 141 deletions(-) diff --git a/packages/google-cloud-filestore/README.md b/packages/google-cloud-filestore/README.md index b645c7fe841..d97cd43a79e 100644 --- a/packages/google-cloud-filestore/README.md +++ b/packages/google-cloud-filestore/README.md @@ -85,41 +85,41 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/ | Sample | Source Code | Try it | | --------------------------- | --------------------------------- | ------ | -| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) | -| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) | -| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) | -| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) | -| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) | -| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) | -| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) | -| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) | -| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) | -| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) | -| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) | -| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) | -| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) | -| Cloud_filestore_manager.create_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) | -| Cloud_filestore_manager.create_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) | -| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) | -| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) | -| Cloud_filestore_manager.delete_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) | -| Cloud_filestore_manager.delete_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) | -| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) | -| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) | -| Cloud_filestore_manager.get_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) | -| Cloud_filestore_manager.get_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) | -| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) | -| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) | -| Cloud_filestore_manager.list_shares | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) | -| Cloud_filestore_manager.list_snapshots | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) | -| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) | -| Cloud_filestore_manager.revert_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) | -| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) | -| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) | -| Cloud_filestore_manager.update_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) | -| Cloud_filestore_manager.update_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) | -| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) | +| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) | +| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) | +| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) | +| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) | +| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) | +| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) | +| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) | +| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) | +| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) | +| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) | +| Cloud_filestore_manager.create_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) | +| Cloud_filestore_manager.create_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) | +| Cloud_filestore_manager.create_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) | +| Cloud_filestore_manager.create_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.delete_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) | +| Cloud_filestore_manager.delete_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) | +| Cloud_filestore_manager.delete_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) | +| Cloud_filestore_manager.delete_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.get_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) | +| Cloud_filestore_manager.get_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) | +| Cloud_filestore_manager.get_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) | +| Cloud_filestore_manager.get_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) | +| Cloud_filestore_manager.list_backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) | +| Cloud_filestore_manager.list_instances | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) | +| Cloud_filestore_manager.list_shares | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) | +| Cloud_filestore_manager.list_snapshots | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) | +| Cloud_filestore_manager.restore_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) | +| Cloud_filestore_manager.revert_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) | +| Cloud_filestore_manager.update_instance | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) | +| Cloud_filestore_manager.update_share | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) | +| Cloud_filestore_manager.update_snapshot | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/quickstart.js,samples/README.md) | +| Quickstart | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/test/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/test/quickstart.js,samples/README.md) | diff --git a/packages/google-cloud-filestore/samples/README.md b/packages/google-cloud-filestore/samples/README.md index 331b8fa7ef7..d1b034fde5f 100644 --- a/packages/google-cloud-filestore/samples/README.md +++ b/packages/google-cloud-filestore/samples/README.md @@ -65,14 +65,14 @@ Before running the samples, make sure you've followed the steps outlined in ### Cloud_filestore_manager.create_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_backup.js` ----- @@ -82,14 +82,14 @@ __Usage:__ ### Cloud_filestore_manager.create_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.create_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.create_instance.js` ----- @@ -99,14 +99,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_backup.js` ----- @@ -116,14 +116,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.delete_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.delete_instance.js` ----- @@ -133,14 +133,14 @@ __Usage:__ ### Cloud_filestore_manager.get_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_backup.js` ----- @@ -150,14 +150,14 @@ __Usage:__ ### Cloud_filestore_manager.get_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.get_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.get_instance.js` ----- @@ -167,14 +167,14 @@ __Usage:__ ### Cloud_filestore_manager.list_backups -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_backups.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_backups.js` ----- @@ -184,14 +184,14 @@ __Usage:__ ### Cloud_filestore_manager.list_instances -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.list_instances.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.list_instances.js` ----- @@ -201,14 +201,14 @@ __Usage:__ ### Cloud_filestore_manager.restore_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.restore_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.restore_instance.js` ----- @@ -218,14 +218,14 @@ __Usage:__ ### Cloud_filestore_manager.update_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_backup.js` ----- @@ -235,14 +235,14 @@ __Usage:__ ### Cloud_filestore_manager.update_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1/cloud_filestore_manager.update_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1/cloud_filestore_manager.update_instance.js` ----- @@ -252,14 +252,14 @@ __Usage:__ ### Cloud_filestore_manager.create_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_backup.js` ----- @@ -269,14 +269,14 @@ __Usage:__ ### Cloud_filestore_manager.create_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_instance.js` ----- @@ -286,14 +286,14 @@ __Usage:__ ### Cloud_filestore_manager.create_share -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_share.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_share.js` ----- @@ -303,14 +303,14 @@ __Usage:__ ### Cloud_filestore_manager.create_snapshot -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.create_snapshot.js` ----- @@ -320,14 +320,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_backup.js` ----- @@ -337,14 +337,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_instance.js` ----- @@ -354,14 +354,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_share -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_share.js` ----- @@ -371,14 +371,14 @@ __Usage:__ ### Cloud_filestore_manager.delete_snapshot -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.delete_snapshot.js` ----- @@ -388,14 +388,14 @@ __Usage:__ ### Cloud_filestore_manager.get_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_backup.js` ----- @@ -405,14 +405,14 @@ __Usage:__ ### Cloud_filestore_manager.get_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_instance.js` ----- @@ -422,14 +422,14 @@ __Usage:__ ### Cloud_filestore_manager.get_share -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_share.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_share.js` ----- @@ -439,14 +439,14 @@ __Usage:__ ### Cloud_filestore_manager.get_snapshot -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.get_snapshot.js` ----- @@ -456,14 +456,14 @@ __Usage:__ ### Cloud_filestore_manager.list_backups -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_backups.js` ----- @@ -473,14 +473,14 @@ __Usage:__ ### Cloud_filestore_manager.list_instances -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_instances.js` ----- @@ -490,14 +490,14 @@ __Usage:__ ### Cloud_filestore_manager.list_shares -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_shares.js` ----- @@ -507,14 +507,14 @@ __Usage:__ ### Cloud_filestore_manager.list_snapshots -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.list_snapshots.js` ----- @@ -524,14 +524,14 @@ __Usage:__ ### Cloud_filestore_manager.restore_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.restore_instance.js` ----- @@ -541,14 +541,14 @@ __Usage:__ ### Cloud_filestore_manager.revert_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.revert_instance.js` ----- @@ -558,14 +558,14 @@ __Usage:__ ### Cloud_filestore_manager.update_backup -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_backup.js` ----- @@ -575,14 +575,14 @@ __Usage:__ ### Cloud_filestore_manager.update_instance -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_instance.js` ----- @@ -592,14 +592,14 @@ __Usage:__ ### Cloud_filestore_manager.update_share -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_share.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_share.js` ----- @@ -609,14 +609,14 @@ __Usage:__ ### Cloud_filestore_manager.update_snapshot -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js` +`node packages/google-cloud-filestore/samples/generated/v1beta1/cloud_filestore_manager.update_snapshot.js` ----- @@ -626,14 +626,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/quickstart.js` +`node packages/google-cloud-filestore/samples/quickstart.js` ----- @@ -643,14 +643,14 @@ __Usage:__ ### Quickstart -View the [source code](https://github.com/googleapis/google-cloud-node/blob/main//workspace/google-cloud-node/samples/test/quickstart.js). +View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-filestore/samples/test/quickstart.js). -[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=/workspace/google-cloud-node/samples/test/quickstart.js,samples/README.md) +[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-filestore/samples/test/quickstart.js,samples/README.md) __Usage:__ -`node /workspace/google-cloud-node/samples/test/quickstart.js` +`node packages/google-cloud-filestore/samples/test/quickstart.js` diff --git a/release-please-config.json b/release-please-config.json index 3f14f470471..e56e8660469 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -64,4 +64,4 @@ } ], "release-type": "node" -} +} \ No newline at end of file From a378bdf6349eb5103eddee7d807b5040a720a1ce Mon Sep 17 00:00:00 2001 From: Sofia Leon Date: Tue, 15 Nov 2022 16:26:21 -0800 Subject: [PATCH 59/59] update samples test --- .../google-cloud-filestore/samples/test/quickstart.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/google-cloud-filestore/samples/test/quickstart.js b/packages/google-cloud-filestore/samples/test/quickstart.js index 4664a2658ea..ce0b4d1652e 100644 --- a/packages/google-cloud-filestore/samples/test/quickstart.js +++ b/packages/google-cloud-filestore/samples/test/quickstart.js @@ -17,16 +17,21 @@ const path = require('path'); const assert = require('assert'); const cp = require('child_process'); -const {describe, it} = require('mocha'); +const {describe, it, before} = require('mocha'); +const {CloudFilestoreManagerClient} = require('@google-cloud/filestore'); +const client = new CloudFilestoreManagerClient(); const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'}); const cwd = path.join(__dirname, '..'); -const project = process.env.GCLOUD_PROJECT; const location = 'us-central1-a'; describe('Quickstart', () => { + let project; + before(async () => { + project = await client.getProjectId(); + }); it('should run quickstart', async () => { const out = execSync(`node ./quickstart.js ${project} ${location}`, {cwd}); assert.strictEqual(out.includes('fileShares'), true);